aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2014-10-03 14:35:15 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2014-10-03 14:35:15 -0300
commit9596f122d60208f781c8d0c342545a46477d2ecd (patch)
treeb13d8af56573b60c6e7f2ae75cecbccbc97075f0
parent23ef52514edbc1ded7e1a23217a87a5f10bc54b7 (diff)
parentf50430ee3e14fbde1dd83c38f55afe70e567f77d (diff)
downloadrails-9596f122d60208f781c8d0c342545a46477d2ecd.tar.gz
rails-9596f122d60208f781c8d0c342545a46477d2ecd.tar.bz2
rails-9596f122d60208f781c8d0c342545a46477d2ecd.zip
Merge pull request #17167 from kuldeepaggarwal/doc-define_model_callbacks
add notes for `define_model_callbacks`
-rw-r--r--activemodel/lib/active_model/callbacks.rb3
-rw-r--r--activesupport/lib/active_support/callbacks.rb3
2 files changed, 6 insertions, 0 deletions
diff --git a/activemodel/lib/active_model/callbacks.rb b/activemodel/lib/active_model/callbacks.rb
index b27a39b787..467028f9e8 100644
--- a/activemodel/lib/active_model/callbacks.rb
+++ b/activemodel/lib/active_model/callbacks.rb
@@ -97,6 +97,9 @@ module ActiveModel
# # obj is the MyModel instance that the callback is being called on
# end
# end
+ #
+ # NOTE: +method_name+ passed to `define_model_callbacks` must not end with
+ # `!`, `?` and `=`.
def define_model_callbacks(*callbacks)
options = callbacks.extract_options!
options = {
diff --git a/activesupport/lib/active_support/callbacks.rb b/activesupport/lib/active_support/callbacks.rb
index 0c8c1d7dfb..21a2f54bc1 100644
--- a/activesupport/lib/active_support/callbacks.rb
+++ b/activesupport/lib/active_support/callbacks.rb
@@ -719,6 +719,9 @@ module ActiveSupport
# define_callbacks :save, scope: [:name]
#
# would call <tt>Audit#save</tt>.
+ #
+ # NOTE: +method_name+ passed to `define_model_callbacks` must not end with
+ # `!`, `?` and `=`.
def define_callbacks(*names)
options = names.extract_options!