diff options
author | Marcelo Giorgi <marklazz.uy@gmail.com> | 2010-10-03 12:16:52 -0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-11-11 17:05:07 +0100 |
commit | 2bb1c202b48c4f1c8d81927fb3e5fc00806231f9 (patch) | |
tree | 465dc996c8e6be62cae40753c35c42788982636f /actionpack/lib | |
parent | 7846fb79e1296986c41250bfea2e115e7683fa61 (diff) | |
download | rails-2bb1c202b48c4f1c8d81927fb3e5fc00806231f9.tar.gz rails-2bb1c202b48c4f1c8d81927fb3e5fc00806231f9.tar.bz2 rails-2bb1c202b48c4f1c8d81927fb3e5fc00806231f9.zip |
Make after_filter halt when before_filter renders or redirects [#5648 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/abstract_controller/callbacks.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/actionpack/lib/abstract_controller/callbacks.rb b/actionpack/lib/abstract_controller/callbacks.rb index 7b0d80614d..094e62b9c7 100644 --- a/actionpack/lib/abstract_controller/callbacks.rb +++ b/actionpack/lib/abstract_controller/callbacks.rb @@ -83,6 +83,7 @@ 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.wrap(options[:if]) << "!halted") if #{filter == :after} set_callback(:process_action, :#{filter}, name, options) # set_callback(:process_action, :before_filter, name, options) end # end end # end @@ -91,6 +92,7 @@ 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.wrap(options[:if]) << "!halted") if #{filter == :after} set_callback(:process_action, :#{filter}, name, options.merge(:prepend => true)) # set_callback(:process_action, :before, name, options.merge(:prepend => true)) end # end end # end |