class ActiveAdmin::EventDispatcher

Public Instance Methods

dispatch(event, *args) click to toggle source
# File lib/active_admin/event.rb, line 12
def dispatch(event, *args)
  Deprecation.warn "`ActiveAdmin::Event.dispatch` is deprecated, use `ActiveSupport::Notifications.publish`"
  ActiveSupport::Notifications.publish event, *args
end
subscribe(*event_names, &block) click to toggle source
# File lib/active_admin/event.rb, line 4
def subscribe(*event_names, &block)
  Deprecation.warn "`ActiveAdmin::Event.subscribe` is deprecated, use `ActiveSupport::Notifications.subscribe`"
  event_names.each do |event|
    ActiveSupport::Notifications.subscribe event,
      &wrap_block_for_active_support_notifications(block)
  end
end
wrap_block_for_active_support_notifications(block) click to toggle source
# File lib/active_admin/event.rb, line 17
def wrap_block_for_active_support_notifications block
  proc { |event, *args| block.call *args }
end