From e821611cb6142d2055de565fabe783ffd6ef4cfb Mon Sep 17 00:00:00 2001 From: Paul McMahon Date: Thu, 3 May 2012 18:02:25 +0900 Subject: use extract_options! --- actionpack/lib/action_dispatch/routing/redirection.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_dispatch/routing/redirection.rb b/actionpack/lib/action_dispatch/routing/redirection.rb index 444a79c50d..95c588c00a 100644 --- a/actionpack/lib/action_dispatch/routing/redirection.rb +++ b/actionpack/lib/action_dispatch/routing/redirection.rb @@ -1,5 +1,6 @@ require 'action_dispatch/http/request' require 'active_support/core_ext/uri' +require 'active_support/core_ext/array/extract_options' require 'rack/utils' module ActionDispatch @@ -99,7 +100,7 @@ module ActionDispatch # match 'accounts/:name' => redirect(SubdomainRedirector.new('api')) # def redirect(*args, &block) - options = args.last.is_a?(Hash) ? args.pop : {} + options = args.extract_options! status = options.delete(:status) || 301 return OptionRedirect.new(status, options) if options.any? -- cgit v1.2.3