stator 0.0.15 → 0.0.16

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.
@@ -31,8 +31,12 @@ module Stator
31
31
  end
32
32
 
33
33
 
34
- def state_changed?
35
- @record.send("#{@machine.field}_changed?")
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
 
@@ -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)
@@ -1,7 +1,7 @@
1
1
  module Stator
2
2
  MAJOR = 0
3
3
  MINOR = 0
4
- PATCH = 15
4
+ PATCH = 16
5
5
  PRERELEASE = nil
6
6
 
7
7
  VERSION = [MAJOR, MINOR, PATCH, PRERELEASE].compact.join('.')
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.15
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-28 00:00:00.000000000 Z
12
+ date: 2014-03-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord