private Method

Callbacks.callback(method)

There's no documentation for this item.

Source Code

# File active_record/callbacks.rb, line 302
def callback(method)
  notify(method)

  callbacks_for(method).each do |callback|
    result = case callback
      when Symbol
        self.send(callback)
      when String
        eval(callback, binding)
      when Proc, Method
        callback.call(self)
      else
        if callback.respond_to?(method)
          callback.send(method, self)
        else
          raise ActiveRecordError, "Callbacks must be a symbol denoting the method to call, a string to be evaluated, a block to be invoked, or an object responding to the callback method."
        end
    end
    return false if result == false
  end

  result = send(method) if respond_to_without_attributes?(method)

  return result
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.