lib/reactor/models/concerns/eventable.rb in reactor-0.1.2 vs lib/reactor/models/concerns/eventable.rb in reactor-0.1.3

- old
+ new

@@ -22,21 +22,21 @@ private def schedule_events self.class.events.each do |name, data| - data = data.merge( + event = data.merge( at: ( data[:at] ? send(data[:at]) : nil), actor: self ).except(:watch) need_to_fire = case (ifarg = data[:if]) when Proc - what = instance_exec &ifarg + instance_exec &ifarg when Symbol send(ifarg) else true end - Reactor::Event.delay.publish name, data if need_to_fire + Reactor::Event.delay.publish name, event if need_to_fire end end def reschedule_events self.class.events.each do |name, data| \ No newline at end of file