can_has_state 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/can_has_state/machine.rb +5 -1
- data/lib/can_has_state/version.rb +1 -1
- 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: f184667378a0c0620b44d5d14cd31a4c44e1fde7
|
4
|
+
data.tar.gz: db3b46381463581e04f3c78920258a7d9a1210eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 35b55898ee69682615e8d413cf928b1cda086e6bfaf51c89323fc5a71ce17c9e1362263eb0dc57519c02eb24a6eedcaaf99afeaa156f8a933b4cf14f7a272983
|
7
|
+
data.tar.gz: 579f3569d6c9c5fcff3bc181c0db73c65c40a7fdd76945798c53c3e0dd2d83036d8913611a8d2ff2c664b53255db4a9d33c5f0233645d18e78d7a8a209a73f76
|
data/README.md
CHANGED
@@ -71,7 +71,11 @@ module CanHasState
|
|
71
71
|
# clear record of called triggers
|
72
72
|
@triggers_called[column] = nil
|
73
73
|
|
74
|
-
|
74
|
+
if respond_to?("#{column}_before_last_save") # rails 5.1+
|
75
|
+
from, to = send("#{column}_before_last_save"), send(column)
|
76
|
+
else
|
77
|
+
from, to = send("#{column}_was"), send(column)
|
78
|
+
end
|
75
79
|
next if from == to
|
76
80
|
sm.trigger(self, from, to, :deferred)
|
77
81
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: can_has_state
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- thomas morgan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|