Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

use extract_options! #6139

Merged
merged 1 commit into from

3 participants

@pwim

No description provided.

@carlosantoniodasilva

Please add a require to array/extract_options from active_support. Thanks!

@pwim

@carlosantoniodasilva Thanks! I updated my pull request to include the require.

@carlosantoniodasilva

@pwin Great, thanks!

@josevalim josevalim merged commit fb7abea into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 3, 2012
  1. @pwim

    use extract_options!

    pwim authored
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 1 deletion.
  1. +2 −1  actionpack/lib/action_dispatch/routing/redirection.rb
View
3  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 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?
Something went wrong with that request. Please try again.