Skip to content

Commit

Permalink
use extract_options!
Browse files Browse the repository at this point in the history
  • Loading branch information
pwim committed May 3, 2012
1 parent 5c0cbb3 commit e821611
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion 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
Expand Down Expand Up @@ -99,7 +100,7 @@ module Redirection
# 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?
Expand Down

0 comments on commit e821611

Please sign in to comment.