lib/reactor/event.rb in reactor-0.13.0 vs lib/reactor/event.rb in reactor-0.14.0

- old
+ new

@@ -115,11 +115,11 @@ __data__["#{method}_type"].constantize.find(__data__["#{method}_id"]) end def fire_database_driven_subscribers(data, name) #TODO: support more matching? - Reactor::Subscriber.where(event_name: [name, '*']).each do |subscriber| - Reactor::Subscriber.delay.fire subscriber.id, data + Reactor::Subscriber.where(event_name: [name, '*']).pluck(:id).each do |model_id| + Reactor::Workers::DatabaseSubscriberWorker.perform_async model_id, data end end def fire_block_subscribers(data, name) ((Reactor::SUBSCRIBERS[name.to_s] || []) | (Reactor::SUBSCRIBERS['*'] || [])).each { |s| s.perform_where_needed(data) }