Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

remove :as and :anchor from IGNORE_OPTIONS

  • Loading branch information...
commit c91648b107a967123e523393962e92f89e989dcf 1 parent 5491710
@tenderlove tenderlove authored
Showing with 5 additions and 3 deletions.
  1. +5 −3 actionpack/lib/action_dispatch/routing/mapper.rb
View
8 actionpack/lib/action_dispatch/routing/mapper.rb
@@ -60,11 +60,11 @@ def constraint_args(constraint, request)
end
class Mapping #:nodoc:
- IGNORE_OPTIONS = [:as, :via, :on, :constraints, :defaults, :only, :except, :anchor, :shallow, :shallow_path, :shallow_prefix]
+ IGNORE_OPTIONS = [:via, :on, :constraints, :defaults, :only, :except, :shallow, :shallow_path, :shallow_prefix]
ANCHOR_CHARACTERS_REGEX = %r{\A(\\A|\^)|(\\Z|\\z|\$)\Z}
attr_reader :scope, :options, :requirements, :conditions, :defaults
- attr_reader :to, :default_controller, :default_action
+ attr_reader :to, :default_controller, :default_action, :as, :anchor
def initialize(scope, path, options)
@scope = scope
@@ -74,6 +74,8 @@ def initialize(scope, path, options)
@to = options.delete :to
@default_controller = options[:controller] || scope[:controller]
@default_action = options[:action] || scope[:action]
+ @as = options.delete :as
+ @anchor = options.delete :anchor
formatted = options.delete :format
@@ -87,7 +89,7 @@ def initialize(scope, path, options)
end
def to_route
- [ app, conditions, requirements, defaults, options[:as], options[:anchor] ]
+ [ app, conditions, requirements, defaults, as, anchor ]
end
private
Please sign in to comment.
Something went wrong with that request. Please try again.