statesman 10.2.0 → 10.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/statesman/adapters/active_record.rb +3 -2
- data/lib/statesman/version.rb +1 -1
- data/spec/statesman/adapters/active_record_spec.rb +6 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 84f52a986a8c32bd6f42d6e450da1b26b8608cf4dc7434a163ee602d84425a36
|
4
|
+
data.tar.gz: 8aaf748af7917715006dd2bd8b7946656ecbaa3cfd9dd7df9bd776da06f5ce41
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc43e626d95b225a002c423092dc0906aa93365b028f8d9fef20a19c4657bef8761c430321db3046dece32d5b9ed3f8fac667a502ba13bfb9f5df8460d9cfd5d
|
7
|
+
data.tar.gz: 7aa34ddc4e22e611d942db5b6c9751496a203bcb678b5a89ff8772c251515edfa27a4bca92f2c999d499b63105624464dd0e7d42dba5dcb8670d6bafcc1bd517
|
data/CHANGELOG.md
CHANGED
@@ -52,7 +52,7 @@ module Statesman
|
|
52
52
|
|
53
53
|
raise
|
54
54
|
ensure
|
55
|
-
|
55
|
+
reset
|
56
56
|
end
|
57
57
|
|
58
58
|
def history(force_reload: false)
|
@@ -76,7 +76,8 @@ module Statesman
|
|
76
76
|
end
|
77
77
|
|
78
78
|
def reset
|
79
|
-
remove_instance_variable(:@last_transition)
|
79
|
+
remove_instance_variable(:@last_transition) \
|
80
|
+
if instance_variable_defined?(:@last_transition)
|
80
81
|
end
|
81
82
|
|
82
83
|
private
|
data/lib/statesman/version.rb
CHANGED
@@ -388,6 +388,12 @@ describe Statesman::Adapters::ActiveRecord, active_record: true do
|
|
388
388
|
end
|
389
389
|
end
|
390
390
|
|
391
|
+
describe "#reset" do
|
392
|
+
it "works with empty cache" do
|
393
|
+
expect { model.state_machine.reset }.to_not raise_error
|
394
|
+
end
|
395
|
+
end
|
396
|
+
|
391
397
|
it "resets last with #reload" do
|
392
398
|
model.save!
|
393
399
|
ActiveRecord::Base.transaction do
|