stator 0.0.15 → 0.0.16
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/stator/integration.rb +6 -2
- data/lib/stator/transition.rb +1 -1
- data/lib/stator/version.rb +1 -1
- metadata +2 -2
data/lib/stator/integration.rb
CHANGED
@@ -31,8 +31,12 @@ module Stator
|
|
31
31
|
end
|
32
32
|
|
33
33
|
|
34
|
-
def state_changed?
|
35
|
-
|
34
|
+
def state_changed?(use_previous = false)
|
35
|
+
if use_previous
|
36
|
+
!!@record.previous_changes[@machine.field.to_s]
|
37
|
+
else
|
38
|
+
@record.send("#{@machine.field}_changed?")
|
39
|
+
end
|
36
40
|
end
|
37
41
|
|
38
42
|
|
data/lib/stator/transition.rb
CHANGED
@@ -67,7 +67,7 @@ module Stator
|
|
67
67
|
options[:use_previous] ||= false
|
68
68
|
%Q{
|
69
69
|
(
|
70
|
-
self._stator(#{@namespace.inspect}).integration(self).state_changed?
|
70
|
+
self._stator(#{@namespace.inspect}).integration(self).state_changed?(#{options[:use_previous].inspect})
|
71
71
|
) && (
|
72
72
|
#{@froms.inspect}.include?(self._stator(#{@namespace.inspect}).integration(self).state_was(#{options[:use_previous].inspect})) ||
|
73
73
|
#{@froms.inspect}.include?(::Stator::Transition::ANY)
|
data/lib/stator/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.16
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-03-
|
12
|
+
date: 2014-03-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|