static public Method

Callbacks.included(base)

There's no documentation for this item.

Source Code

# File active_record/callbacks.rb, line 179
def self.included(base) #:nodoc:
  base.extend Observable

  [:create_or_update, :valid?, :create, :update, :destroy].each do |method|
    base.send :alias_method_chain, method, :callbacks
  end

  CALLBACKS.each do |method|
    base.class_eval "def self.\#{method}(*callbacks, &block)\ncallbacks << block if block_given?\nwrite_inheritable_array(\#{method.to_sym.inspect}, callbacks)\nend\n"
  end
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.