module ActiveAdmin::Callbacks
Protected Instance Methods
call_callback_with(method, *args)
click to toggle source
Simple callback system. Implements before and after callbacks for use within the controllers.
We didn't use the ActiveSupport callbacks becuase they do not support passing in any arbitrary object into the callback method (which we need to do)
# File lib/active_admin/callbacks.rb, line 14 def call_callback_with(method, *args) case method when Symbol send(method, *args) when Proc instance_exec(*args, &method) else raise "Please register with callbacks using a symbol or a block/proc." end end