diff options
author | Bogdan Gusiev <agresso@gmail.com> | 2012-02-03 17:57:53 +0200 |
---|---|---|
committer | Bogdan Gusiev <agresso@gmail.com> | 2012-02-03 17:57:53 +0200 |
commit | 766195563469ce8c081a0937974e3cd2bb84f107 (patch) | |
tree | e4b70359ffbdd876d82376f7e8a48ac46a7cd744 /activesupport/lib | |
parent | 2abaa19e77d1097730cfa6e0924ee7c1660ac01f (diff) | |
download | rails-766195563469ce8c081a0937974e3cd2bb84f107.tar.gz rails-766195563469ce8c081a0937974e3cd2bb84f107.tar.bz2 rails-766195563469ce8c081a0937974e3cd2bb84f107.zip |
AS::Callbacks: :skip_after_callbacks_if_terminated option
Diffstat (limited to 'activesupport/lib')
-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 5eaeac2cb3..c84742054a 100644 --- a/activesupport/lib/active_support/callbacks.rb +++ b/activesupport/lib/active_support/callbacks.rb @@ -169,7 +169,7 @@ module ActiveSupport when :after <<-RUBY_EVAL #{code} - if #{@compiled_options} + if #{!chain.config[:skip_after_callbacks_if_terminated] || "!halted"} && #{@compiled_options} #{@filter} end RUBY_EVAL @@ -528,6 +528,11 @@ module ActiveSupport # other callbacks are 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 default after callbacks executed no matter + # if callback chain was terminated or not. + # Option makes sence only when <tt>:terminator</tt> option is specified. + # # * <tt>:rescuable</tt> - By default, after filters are not executed if # the given block or a before filter raises an error. By setting this option # to <tt>true</tt> exception raised by given block is stored and after |