module ActiveSupport::Callbacks
def __run_callbacks__(callbacks, &block)
def __run_callbacks__(callbacks, &block) if callbacks.empty? yield if block_given? else runner = callbacks.compile e = Filters::Environment.new(self, false, nil, block) runner.call(e).value end end
def halted_callback_hook(filter)
This can be overridden in AS::Callback implementors in order
A hook invoked every time a before callback is halted.
def halted_callback_hook(filter) end
def run_callbacks(kind, &block)
save
run_callbacks :save do
if callbacks have been set but no block is given.
result of the block, +nil+ if no callbacks have been set, or +true+
If the callback chain was halted, returns +false+. Otherwise returns the
order.
the block (if given one), and then runs the after callbacks in reverse
Calls the before and around callbacks in the order they were set, yields
Runs the callbacks for the given event.
def run_callbacks(kind, &block) send "_run_#{kind}_callbacks", &block end