Method: ActiveAdmin.before_load

Defined in:
lib/active_admin.rb

.before_load(&block) ⇒ Object

A callback is triggered each time (before) Active Admin loads the configuration files. In development mode, this will happen whenever the user changes files. In production it only happens on boot.

The block takes the current instance of [ActiveAdmin::Application]

Example:

ActiveAdmin.before_load do |app|
  # Do some stuff before AA loads
end

Parameters:

  • block (Block)

    A block to call each time (before) AA loads resources



91
92
93
# File 'lib/active_admin.rb', line 91

def before_load(&block)
  ActiveSupport::Notifications.subscribe ActiveAdmin::Application::BeforeLoadEvent, &wrap_block_for_active_support_notifications(block)
end