state_machines-activemodel 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/state_machines/integrations/active_model.rb +8 -0
- data/lib/state_machines/integrations/active_model/version.rb +1 -1
- data/test/machine_with_failed_before_callbacks_test.rb +0 -1
- data/test/machine_with_initialized_state_test.rb +0 -4
- data/test/machine_with_state_driven_validations_test.rb +0 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9fedf5a156022db7fbe4b11be9b2433a207f62ce
|
4
|
+
data.tar.gz: 949c56beaa83869d7b69e61944d1aaf9a6fa60af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd8da52261883a7a625f5b126c5816db04036f7a08ef40c0881f93aaa06341c93efeaf534f6919faba991792c9e3d6221a27e5d1a334a49c30a8fa751e483be0
|
7
|
+
data.tar.gz: 47c2e5f2cb54a748427d8d3b7a5f89eac3a4cfca40227a0eed3d641a5b11b6e9b294bc328ae95d471ce18501e6120994710bde64dbe5ece52af455c3ce110f27
|
@@ -402,6 +402,14 @@ module StateMachines
|
|
402
402
|
|
403
403
|
protected
|
404
404
|
|
405
|
+
def define_state_initializer
|
406
|
+
define_helper :instance, <<-end_eval, __FILE__, __LINE__ + 1
|
407
|
+
def initialize(params = {})
|
408
|
+
self.class.state_machines.initialize_states(self, {}, params) { super }
|
409
|
+
end
|
410
|
+
end_eval
|
411
|
+
end
|
412
|
+
|
405
413
|
# Whether validations are supported in the integration. Only true if
|
406
414
|
# the ActiveModel feature is enabled on the owner class.
|
407
415
|
def supports_validations?
|
@@ -8,8 +8,6 @@ class MachineWithInitializedStateTest < BaseTestCase
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def test_should_allow_nil_initial_state_when_static
|
11
|
-
# FIXME
|
12
|
-
skip
|
13
11
|
@machine.state nil
|
14
12
|
|
15
13
|
record = @model.new(state: nil)
|
@@ -25,8 +23,6 @@ class MachineWithInitializedStateTest < BaseTestCase
|
|
25
23
|
end
|
26
24
|
|
27
25
|
def test_should_allow_different_initial_state_when_static
|
28
|
-
# FIXME
|
29
|
-
skip
|
30
26
|
record = @model.new(state: 'idling')
|
31
27
|
assert_equal 'idling', record.state
|
32
28
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: state_machines-activemodel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Abdelkader Boudih
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-01
|
12
|
+
date: 2015-02-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: state_machines
|