diff options
Diffstat (limited to 'activemodel/lib/active_model/callbacks.rb')
-rw-r--r-- | activemodel/lib/active_model/callbacks.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/activemodel/lib/active_model/callbacks.rb b/activemodel/lib/active_model/callbacks.rb index eac2761433..8fa9680cb1 100644 --- a/activemodel/lib/active_model/callbacks.rb +++ b/activemodel/lib/active_model/callbacks.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "active_support/core_ext/array/extract_options" module ActiveModel @@ -56,6 +58,9 @@ module ActiveModel # # Would only create the +after_create+ and +before_create+ callback methods in # your class. + # + # NOTE: Calling the same callback multiple times will overwrite previous callback definitions. + # module Callbacks def self.extended(base) #:nodoc: base.class_eval do @@ -98,8 +103,8 @@ module ActiveModel # end # end # - # NOTE: +method_name+ passed to `define_model_callbacks` must not end with - # `!`, `?` or `=`. + # NOTE: +method_name+ passed to define_model_callbacks must not end with + # <tt>!</tt>, <tt>?</tt> or <tt>=</tt>. def define_model_callbacks(*callbacks) options = callbacks.extract_options! options = { |