aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/abstract_controller
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@plataformatec.com.br>2012-02-04 02:53:47 -0800
committerJosé Valim <jose.valim@plataformatec.com.br>2012-02-04 02:53:47 -0800
commitb41ef0a448c025f1f2eef33c28ea565e38491f5c (patch)
tree8a9440bb6c51b8eb6b562d870584b17548c45005 /actionpack/lib/abstract_controller
parentd709b124d1815340f4a2229b05362ea37298288f (diff)
parent766195563469ce8c081a0937974e3cd2bb84f107 (diff)
downloadrails-b41ef0a448c025f1f2eef33c28ea565e38491f5c.tar.gz
rails-b41ef0a448c025f1f2eef33c28ea565e38491f5c.tar.bz2
rails-b41ef0a448c025f1f2eef33c28ea565e38491f5c.zip
Merge pull request #4866 from bogdan/terminate_after_callbacks
AS::Callbacks#define_callbacks: add :terminate_after_callbacks option
Diffstat (limited to 'actionpack/lib/abstract_controller')
-rw-r--r--actionpack/lib/abstract_controller/callbacks.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/actionpack/lib/abstract_controller/callbacks.rb b/actionpack/lib/abstract_controller/callbacks.rb
index d61475c844..44c9ea34ba 100644
--- a/actionpack/lib/abstract_controller/callbacks.rb
+++ b/actionpack/lib/abstract_controller/callbacks.rb
@@ -8,7 +8,7 @@ module AbstractController
include ActiveSupport::Callbacks
included do
- define_callbacks :process_action, :terminator => "response_body"
+ define_callbacks :process_action, :terminator => "response_body", :skip_after_callbacks_if_terminated => true
end
# Override AbstractController::Base's process_action to run the
@@ -165,7 +165,6 @@ module AbstractController
# for details on the allowed parameters.
def #{filter}_filter(*names, &blk) # def before_filter(*names, &blk)
_insert_callbacks(names, blk) do |name, options| # _insert_callbacks(names, blk) do |name, options|
- options[:if] = (Array(options[:if]) << "!halted") if #{filter == :after} # options[:if] = (Array(options[:if]) << "!halted") if false
set_callback(:process_action, :#{filter}, name, options) # set_callback(:process_action, :before, name, options)
end # end
end # end
@@ -174,7 +173,6 @@ module AbstractController
# for details on the allowed parameters.
def prepend_#{filter}_filter(*names, &blk) # def prepend_before_filter(*names, &blk)
_insert_callbacks(names, blk) do |name, options| # _insert_callbacks(names, blk) do |name, options|
- options[:if] = (Array(options[:if]) << "!halted") if #{filter == :after} # options[:if] = (Array(options[:if]) << "!halted") if false
set_callback(:process_action, :#{filter}, name, options.merge(:prepend => true)) # set_callback(:process_action, :before, name, options.merge(:prepend => true))
end # end
end # end