diff options
author | Yves Senn <yves.senn@gmail.com> | 2015-03-31 09:45:59 +0200 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2015-03-31 09:45:59 +0200 |
commit | 347266280efd887fd6f41ac8583ba87c9281b22e (patch) | |
tree | 370053a41f152c736c44e65ccf057150b4775794 | |
parent | f4bb96b8e97870cb7dd0902d1dbc3697bd192383 (diff) | |
parent | 89389c7e72e8506fa461a36e4d1ff67366f9e61a (diff) | |
download | rails-347266280efd887fd6f41ac8583ba87c9281b22e.tar.gz rails-347266280efd887fd6f41ac8583ba87c9281b22e.tar.bz2 rails-347266280efd887fd6f41ac8583ba87c9281b22e.zip |
Merge pull request #19595 from claudiob/fix-docs-set-callback
Fix doc: set_callback also accepts an array of if:
-rw-r--r-- | activesupport/lib/active_support/callbacks.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/activesupport/lib/active_support/callbacks.rb b/activesupport/lib/active_support/callbacks.rb index 08520b1077..9cf09ab266 100644 --- a/activesupport/lib/active_support/callbacks.rb +++ b/activesupport/lib/active_support/callbacks.rb @@ -663,10 +663,12 @@ module ActiveSupport # # ===== Options # - # * <tt>:if</tt> - A symbol naming an instance method or a proc; the - # callback will be called only when it returns a +true+ value. - # * <tt>:unless</tt> - A symbol naming an instance method or a proc; the - # callback will be called only when it returns a +false+ value. + # * <tt>:if</tt> - A symbol, a string or an array of symbols and strings, + # each naming an instance method or a proc; the callback will be called + # only when they all return a true value. + # * <tt>:unless</tt> - A symbol, a string or an array of symbols and + # strings, each naming an instance method or a proc; the callback will + # be called only when they all return a false value. # * <tt>:prepend</tt> - If +true+, the callback will be prepended to the # existing chain rather than appended. def set_callback(name, *filter_list, &block) |