method

define_callbacks

Importance_0
define_callbacks(*callbacks) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activesupport/lib/active_support/callbacks.rb, line 205
      def define_callbacks(*callbacks)
        callbacks.each do |callback|
          class_eval "def self.\#{callback}(*methods, &block)                             # def self.before_save(*methods, &block)\ncallbacks = CallbackChain.build(:\#{callback}, *methods, &block)  #   callbacks = CallbackChain.build(:before_save, *methods, &block)\n@\#{callback}_callbacks ||= CallbackChain.new                     #   @before_save_callbacks ||= CallbackChain.new\n@\#{callback}_callbacks.concat callbacks                          #   @before_save_callbacks.concat callbacks\nend                                                                # end\n#\ndef self.\#{callback}_callback_chain                                # def self.before_save_callback_chain\n@\#{callback}_callbacks ||= CallbackChain.new                     #   @before_save_callbacks ||= CallbackChain.new\n#\nif superclass.respond_to?(:\#{callback}_callback_chain)           #   if superclass.respond_to?(:before_save_callback_chain)\nCallbackChain.new(                                             #     CallbackChain.new(\nsuperclass.\#{callback}_callback_chain +                      #       superclass.before_save_callback_chain +\n@\#{callback}_callbacks                                       #       @before_save_callbacks\n)                                                              #     )\nelse                                                             #   else\n@\#{callback}_callbacks                                         #     @before_save_callbacks\nend                                                              #   end\nend                                                                # end\n"
        end
      end
Register or log in to add new notes.