state_machines 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 592765d98fcb41a672f7aab26d298b350095f2f1
|
4
|
+
data.tar.gz: f5b1d1c24d1d6fef21593c9cccd1a284999f13f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c2fca5379dd4adeac3f69560bacb568117ed3a41c0d65bba0c716c25655cf3a05b958d73db464479e16ecfd9ee4ab269ad37808a74551a8b5e86332a1557154
|
7
|
+
data.tar.gz: 6ec09db4711dad2e998e87ce9d5a645e26429d498c50c5a739ae6911b1ce9e2b23a3176962226ef92d40d19aaf2bad5734f4d3ec82d7a8709a3275ec2774f280
|
@@ -27,7 +27,7 @@ module StateMachines
|
|
27
27
|
|
28
28
|
each_value do |machine|
|
29
29
|
unless machine.dynamic_initial_state?
|
30
|
-
force = options[:static] == :force || !attributes.keys.include?(machine.attribute)
|
30
|
+
force = options[:static] == :force || !attributes.keys.map(&:to_sym).include?(machine.attribute)
|
31
31
|
machine.initialize_state(object, force: force, :to => options[:to])
|
32
32
|
end
|
33
33
|
end if options[:static]
|
@@ -98,4 +98,14 @@ class MachineCollectionStateInitializationTest < StateMachinesTest
|
|
98
98
|
@machines.initialize_states(@object, dynamic: true)
|
99
99
|
assert_equal 'inactive', @object.alarm_state
|
100
100
|
end
|
101
|
+
|
102
|
+
def test_shouldnt_force_state_given_either_as_string_or_symbol
|
103
|
+
@object.state = 'notparked'
|
104
|
+
|
105
|
+
@machines.initialize_states(@object, {}, { state: "parked" })
|
106
|
+
assert_equal 'notparked', @object.state
|
107
|
+
|
108
|
+
@machines.initialize_states(@object, {}, { "state" => "parked" })
|
109
|
+
assert_equal 'notparked', @object.state
|
110
|
+
end
|
101
111
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: state_machines
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
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-02-
|
12
|
+
date: 2015-02-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|