statesman 7.4.0 → 7.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/statesman/adapters/active_record.rb +4 -0
- data/lib/statesman/adapters/memory.rb +4 -0
- data/lib/statesman/machine.rb +4 -0
- data/lib/statesman/version.rb +1 -1
- data/spec/statesman/adapters/active_record_spec.rb +13 -0
- data/spec/support/active_record.rb +5 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9dc585aeecc837bf65850c562c9f41524959bd07c5f7f889284f534c260911c3
|
4
|
+
data.tar.gz: 807ae19092dcce330131916b825964e5f62ff13f8c4bde2e2140dee9d1f9983d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2688beb079f3b1993bd19b4460834a18a4ca1d5eac9733003c7c5f08c1fd2deb19aeb46103a8f799e89c346ac0704368119ff180ed907928c74587b6a6623ea0
|
7
|
+
data.tar.gz: c58db63a374f2474ccc73f0064d9dc089d8e52967b047ef77333fdae9b57eb1798cf428a0e6ec162788eaec99e5758d1bd26118c43944f5edda90261dbcb6845
|
data/lib/statesman/machine.rb
CHANGED
data/lib/statesman/version.rb
CHANGED
@@ -355,6 +355,19 @@ describe Statesman::Adapters::ActiveRecord, active_record: true do
|
|
355
355
|
end
|
356
356
|
end
|
357
357
|
|
358
|
+
it "resets last with #reload" do
|
359
|
+
model.save!
|
360
|
+
ActiveRecord::Base.transaction do
|
361
|
+
model.state_machine.transition_to!(:succeeded)
|
362
|
+
# force to cache value in last_transition instance variable
|
363
|
+
expect(model.state_machine.current_state).to eq("succeeded")
|
364
|
+
raise ActiveRecord::Rollback
|
365
|
+
end
|
366
|
+
expect(model.state_machine.current_state).to eq("succeeded")
|
367
|
+
model.reload
|
368
|
+
expect(model.state_machine.current_state).to eq("initial")
|
369
|
+
end
|
370
|
+
|
358
371
|
context "with a namespaced model" do
|
359
372
|
before do
|
360
373
|
CreateNamespacedARModelMigration.migrate(:up)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: statesman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.4.
|
4
|
+
version: 7.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GoCardless
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ammeter
|
@@ -303,7 +303,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
303
303
|
- !ruby/object:Gem::Version
|
304
304
|
version: '0'
|
305
305
|
requirements: []
|
306
|
-
rubygems_version: 3.
|
306
|
+
rubygems_version: 3.2.0.rc.1
|
307
307
|
signing_key:
|
308
308
|
specification_version: 4
|
309
309
|
summary: A statesman-like state machine library
|