lib/reactor/controllers/concerns/actions/update_event.rb in reactor-0.13.0 vs lib/reactor/controllers/concerns/actions/update_event.rb in reactor-0.14.0
- old
+ new
@@ -1,14 +1,18 @@
-class Reactor::ResourceActionable::UpdateEvent < Reactor::ResourceActionable::ActionEvent
- perform do
- if actionable_resource.valid?
- action_event "#{resource_name}_updated",
- target: actionable_resource,
- changes: actionable_resource.previous_changes.as_json
- else
- action_event "#{resource_name}_update_failed",
- target: actionable_resource,
- errors: actionable_resource.errors.as_json,
- attributes: params[resource_name]
+module Reactor
+ module ResourceActionable
+ class UpdateEvent < ActionEvent
+ perform do
+ if actionable_resource.valid?
+ action_event "#{resource_name}_updated",
+ target: actionable_resource,
+ changes: actionable_resource.previous_changes.as_json
+ else
+ action_event "#{resource_name}_update_failed",
+ target: actionable_resource,
+ errors: actionable_resource.errors.as_json,
+ attributes: params[resource_name]
+ end
+ end
end
end
-end
\ No newline at end of file
+end