From 8c1889c926326ca97cd9b4b1fb0017d13f208b03 Mon Sep 17 00:00:00 2001 From: claudiob Date: Sun, 14 Dec 2014 17:55:30 -0800 Subject: 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. --- activesupport/lib/active_support/callbacks.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'activesupport/lib') 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 # # * :terminator - 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. # # * :skip_after_callbacks_if_terminated - Determines if after # callbacks should be terminated by the :terminator option. By -- cgit v1.2.3