Module: ActionController::EventHelper
- Defined in:
- lib/rails_ext/action_controller/event_helper.rb
Instance Method Summary collapse
- #trigger_event(object, change = nil, options = {}) ⇒ Object
- #trigger_events(object, *changes) ⇒ Object
Instance Method Details
#trigger_event(object, change = nil, options = {}) ⇒ Object
11 12 13 14 |
# File 'lib/rails_ext/action_controller/event_helper.rb', line 11 def trigger_event(object, change = nil, = {}) type = :"#{object.class.name.underscore}_#{change}" Adva::Event.trigger type, object, self, end |
#trigger_events(object, *changes) ⇒ Object
3 4 5 6 7 8 9 |
# File 'lib/rails_ext/action_controller/event_helper.rb', line 3 def trigger_events(object, *changes) = changes. # changes += object.state_changes changes.uniq.each do |change| trigger_event(object, change, ) end end |