Sha256: 5bc714e1e1ee5d38652d2eaa728c83f668a99ac7dc7c5c81ef859b6707acbeac
Contents?: true
Size: 778 Bytes
Versions: 30
Compression:
Stored size: 778 Bytes
Contents
module ActiveAdmin class EventDispatcher 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 def dispatch(event, *args) Deprecation.warn "`ActiveAdmin::Event.dispatch` is deprecated, use `ActiveSupport::Notifications.publish`" ActiveSupport::Notifications.publish event, *args end def wrap_block_for_active_support_notifications block proc { |event, *args| block.call *args } end end # ActiveAdmin::Event is set to a dispatcher Event = EventDispatcher.new end
Version data entries
30 entries across 30 versions & 5 rubygems