Permalink
Browse files

remove :constraints from IGNORE_OPTIONS

  • Loading branch information...
1 parent 3346d52 commit 82f115758e754cac78f753428085c76c04628bb4 @tenderlove tenderlove committed May 30, 2014
Showing with 5 additions and 4 deletions.
  1. +5 −4 actionpack/lib/action_dispatch/routing/mapper.rb
@@ -60,7 +60,7 @@ def constraint_args(constraint, request)
end
class Mapping #:nodoc:
- IGNORE_OPTIONS = [:constraints, :defaults, :only, :except, :shallow, :shallow_path, :shallow_prefix]
+ IGNORE_OPTIONS = [:defaults, :only, :except, :shallow, :shallow_path, :shallow_prefix]
ANCHOR_CHARACTERS_REGEX = %r{\A(\\A|\^)|(\\Z|\\z|\$)\Z}
attr_reader :scope, :options, :requirements, :conditions, :defaults
@@ -79,19 +79,20 @@ def initialize(scope, path, options)
formatted = options.delete :format
via = Array(options.delete(:via) { [] })
- @blocks = blocks(options[:constraints], scope[:blocks])
+ options_constraints = options.delete :constraints
+ @blocks = blocks(options_constraints, scope[:blocks])
path = normalize_path! path, formatted
ast = path_ast path
path_params = path_params ast
@options = normalize_options!(options, formatted, path_params, ast)
- constraints = constraints(options[:constraints], scope[:constraints])
+ constraints = constraints(options_constraints, scope[:constraints])
normalize_requirements!(path_params, formatted, constraints)
normalize_conditions!(path_params, path, ast, via, constraints)
- normalize_defaults!(formatted, options[:constraints])
+ normalize_defaults!(formatted, options_constraints)
end
def to_route

0 comments on commit 82f1157

Please sign in to comment.