diff options
author | claudiob <claudiob@gmail.com> | 2014-12-14 17:55:30 -0800 |
---|---|---|
committer | claudiob <claudiob@gmail.com> | 2014-12-14 19:12:54 -0800 |
commit | 8c1889c926326ca97cd9b4b1fb0017d13f208b03 (patch) | |
tree | bcb59f4cbdccc5a2afe8b2c34955e60e15b66b65 /activesupport/lib | |
parent | 7607687c9166f8b2f8aa4d107bdbaadb99d4bb43 (diff) | |
download | rails-8c1889c926326ca97cd9b4b1fb0017d13f208b03.tar.gz rails-8c1889c926326ca97cd9b4b1fb0017d13f208b03.tar.bz2 rails-8c1889c926326ca97cd9b4b1fb0017d13f208b03.zip |
Add test for `:skip_after_callbacks_if_terminated`
`define_callbacks` from `ActiveSupport::Callbacks` accepts the
`:skip_after_callbacks_if_terminated` option since #4866 but the option
is not tested anywhere.
This commit adds tests and fixes documentation for the option, making it clear
that halting a callback chain only stops following `before_` and `around_`
callbacks by default.
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/callbacks.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/activesupport/lib/active_support/callbacks.rb b/activesupport/lib/active_support/callbacks.rb index 24c702b602..95dbc9a0cb 100644 --- a/activesupport/lib/active_support/callbacks.rb +++ b/activesupport/lib/active_support/callbacks.rb @@ -659,16 +659,17 @@ module ActiveSupport # ===== Options # # * <tt>:terminator</tt> - Determines when a before filter will halt the - # callback chain, preventing following callbacks from being called and - # the event from being triggered. This should be a lambda to be executed. + # callback chain, preventing following before and around callbacks from + # being called and the event from being triggered. + # This should be a lambda to be executed. # The current object and the return result of the callback will be called # with the lambda. # # define_callbacks :validate, terminator: ->(target, result) { result == false } # # In this example, if any before validate callbacks returns +false+, - # other callbacks are not executed. Defaults to +false+, meaning no value - # halts the chain. + # any successive before and around callback is not executed. + # Defaults to +false+, meaning no value halts the chain. # # * <tt>:skip_after_callbacks_if_terminated</tt> - Determines if after # callbacks should be terminated by the <tt>:terminator</tt> option. By |