class RailsEventSourcing::ReactorJob

Public Instance Methods

perform(event, reactor_class) click to toggle source
# File lib/rails-event-sourcing/reactor_job.rb, line 6
def perform(event, reactor_class)
  reactor = reactor_class.constantize
  if reactor.ancestors.include? RailsEventSourcing::BaseEvent
    reactor.create!(aggregate: event.aggregate)
  end
end