lib/reactor/models/concerns/eventable.rb in reactor-0.1.4 vs lib/reactor/models/concerns/eventable.rb in reactor-0.2.0

- old
+ new

@@ -23,11 +23,13 @@ private def schedule_events self.class.events.each do |name, data| event = data.merge( - at: ( data[:at] ? send(data[:at]) : nil), actor: self + actor: ( data[:actor] ? send(data[:actor]) : self ), + target: ( data[:target] ? send(data[:target]) : nil), + at: ( data[:at] ? send(data[:at]) : nil) ).except(:watch, :if) need_to_fire = case (ifarg = data[:if]) when Proc instance_exec &ifarg when Symbol @@ -42,10 +44,11 @@ def reschedule_events self.class.events.each do |name, data| if data[:at] && send("#{data[:watch] || data[:at]}_changed?") Reactor::Event.delay.reschedule name, at: send(data[:at]), - actor: self, + actor: ( data[:actor] ? send(data[:actor]) : self ), + target: ( data[:target] ? send(data[:target]) : nil), was: send("#{data[:at]}_was") end if data[:if] need_to_fire = case (ifarg = data[:if]) \ No newline at end of file