state-notifier 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/state/notifier/version.rb +1 -1
- data/lib/state/notifier.rb +5 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b8ed956490ad32c8faecc84aee9bb8db94196a26
|
4
|
+
data.tar.gz: 777a2ba40ff270a9382ff88f9c5dda5e87983296
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b034c246058e029499738f24a93f370606c732eeea6ea25c5697f76a61e3227e511802f692dbd4e7d754ba1c3c60696b95861dd4d376e410cc1235077ea1eb8c
|
7
|
+
data.tar.gz: 4db16ec677537145bbdfb47aae523139ad1171e2dae96e40a112e6aeb0a53cc7088e8325e78c54cea71b39f12f214d6d2b89bf6b580ac6110fc7ec349158429a
|
data/lib/state/notifier.rb
CHANGED
@@ -29,9 +29,11 @@ module State
|
|
29
29
|
included do
|
30
30
|
after_create {notify_targets :created}
|
31
31
|
after_update {notify_targets :updated unless (changed - self.class.reserved_attributes).empty?}
|
32
|
-
if respond_to?(:state_machine)
|
33
|
-
|
34
|
-
|
32
|
+
if respond_to?(:state_machines) && respond_to?(:state_machine)
|
33
|
+
state_machines.keys.each do |machine|
|
34
|
+
state_machine machine do
|
35
|
+
after_transition { |record, transition| record.notify_transition transition }
|
36
|
+
end
|
35
37
|
end
|
36
38
|
end
|
37
39
|
end
|