lib/reactor/models/concerns/publishable.rb in reactor-0.4.5 vs lib/reactor/models/concerns/publishable.rb in reactor-0.4.6
- old
+ new
@@ -47,10 +47,10 @@
if data[:at] && previous_changes[attr_changed_method]
Reactor::Event.reschedule name,
at: send(data[:at]),
actor: ( data[:actor] ? send(data[:actor]) : self ),
target: ( data[:target] ? self : nil),
- was: previous_changes[attr_changed_method][0]
+ was: previous_changes[data[:at]].try(:first) || send("#{data[:at]}_was")
end
if data[:if]
need_to_fire = case (ifarg = data[:if])
when Proc
instance_exec &ifarg
\ No newline at end of file