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)\ncallbacks = CallbackChain.build(:\#{callback}, *methods, &block)\n(@\#{callback}_callbacks ||= CallbackChain.new).concat callbacks\nend\n\ndef self.\#{callback}_callback_chain\n@\#{callback}_callbacks ||= CallbackChain.new\n\nif superclass.respond_to?(:\#{callback}_callback_chain)\nCallbackChain.new(superclass.\#{callback}_callback_chain + @\#{callback}_callbacks)\nelse\n@\#{callback}_callbacks\nend\nend\n"
        end
      end
Register or log in to add new notes.