diff options
author | Edouard CHIN <edouard.chin@shopify.com> | 2016-06-09 21:04:58 -0400 |
---|---|---|
committer | Edouard CHIN <edouard.chin@shopify.com> | 2016-06-10 11:31:11 -0400 |
commit | 3da701dd3c76abbb9013e71daf26a0eee8dfa744 (patch) | |
tree | 22b327229c6eafba931e03264ef6afbd01c4e68c | |
parent | f9a39e0d51400c62348e6e299d4c53e9eababef2 (diff) | |
download | rails-3da701dd3c76abbb9013e71daf26a0eee8dfa744.tar.gz rails-3da701dd3c76abbb9013e71daf26a0eee8dfa744.tar.bz2 rails-3da701dd3c76abbb9013e71daf26a0eee8dfa744.zip |
[ci skip] `define_model_callbacks` only exist in active model:
- Also added a note when calling multiple time `define_callbacks`
-rw-r--r-- | activesupport/lib/active_support/callbacks.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/callbacks.rb b/activesupport/lib/active_support/callbacks.rb index 904d3f0eb0..1559fe641c 100644 --- a/activesupport/lib/active_support/callbacks.rb +++ b/activesupport/lib/active_support/callbacks.rb @@ -736,8 +736,13 @@ module ActiveSupport # # would call <tt>Audit#save</tt>. # - # NOTE: +method_name+ passed to `define_model_callbacks` must not end with + # ===== Notes + # + # +names+ passed to `define_callbacks` must not end with # `!`, `?` or `=`. + # + # Calling `define_callbacks` multiple times with the same +names+ will + # overwrite previous callbacks registered with `set_callback`. def define_callbacks(*names) options = names.extract_options! |