lib/reactor/controllers/concerns/actions/create_event.rb in reactor-0.13.0 vs lib/reactor/controllers/concerns/actions/create_event.rb in reactor-0.14.0

- old
+ new

@@ -1,14 +1,18 @@ -class Reactor::ResourceActionable::CreateEvent < Reactor::ResourceActionable::ActionEvent - perform do - if actionable_resource.valid? - action_event "#{resource_name}_created", - target: actionable_resource, - attributes: params[resource_name] - else - action_event "#{resource_name}_create_failed", - errors: actionable_resource.errors.as_json, - attributes: params[resource_name], - target: nested_resource +module Reactor + module ResourceActionable + class CreateEvent < ActionEvent + perform do + if actionable_resource.valid? + action_event "#{resource_name}_created", + target: actionable_resource, + attributes: params[resource_name] + else + action_event "#{resource_name}_create_failed", + errors: actionable_resource.errors.as_json, + attributes: params[resource_name], + target: nested_resource + end + end end end -end \ No newline at end of file +end