aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2012-03-31 12:49:57 -0300
committerPiotr Sarnacki <drogus@gmail.com>2012-03-31 17:59:21 +0200
commit27fc6ec95eb7a1756fb86693b6fe8e03f1d66ef3 (patch)
treeff5967d5ea35dabc9f1fb34a876cc52356e133d7 /actionpack/lib
parent9894d1665380d36a05f6444ed6fd15be85daf880 (diff)
downloadrails-27fc6ec95eb7a1756fb86693b6fe8e03f1d66ef3.tar.gz
rails-27fc6ec95eb7a1756fb86693b6fe8e03f1d66ef3.tar.bz2
rails-27fc6ec95eb7a1756fb86693b6fe8e03f1d66ef3.zip
Fix the redirect when it receive blocks with arity of 1.
Closes #5677
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_dispatch/routing/redirection.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/routing/redirection.rb b/actionpack/lib/action_dispatch/routing/redirection.rb
index 330400e139..4d98f20826 100644
--- a/actionpack/lib/action_dispatch/routing/redirection.rb
+++ b/actionpack/lib/action_dispatch/routing/redirection.rb
@@ -102,7 +102,8 @@ module ActionDispatch
if block && block.respond_to?(:arity) && block.arity < 2
msg = "redirect blocks with arity of #{block.arity} are deprecated. Your block must take 2 parameters: the environment, and a request object"
ActiveSupport::Deprecation.warn msg
- block = lambda { |params, _| block.call(params) }
+ deprecated_block = block
+ block = lambda { |params, _| deprecated_block.call(params) }
end
raise ArgumentError, "redirection argument not supported" unless block