Permalink
Browse files

disconnect normalize_defaults! from options[:constraints]

  • Loading branch information...
1 parent 496e25a commit 3346d52248877105f57345f51de68322fa7b1ac1 @tenderlove tenderlove committed May 30, 2014
Showing with 6 additions and 6 deletions.
  1. +6 −6 actionpack/lib/action_dispatch/routing/mapper.rb
@@ -91,7 +91,7 @@ def initialize(scope, path, options)
normalize_requirements!(path_params, formatted, constraints)
normalize_conditions!(path_params, path, ast, via, constraints)
- normalize_defaults!(formatted)
+ normalize_defaults!(formatted, options[:constraints])
end
def to_route
@@ -168,7 +168,7 @@ def verify_regexp_requirement(requirement)
end
end
- def normalize_defaults!(formatted)
+ def normalize_defaults!(formatted, options_constraints)
@defaults.merge!(scope[:defaults]) if scope[:defaults]
@defaults.merge!(options[:defaults]) if options[:defaults]
@@ -178,14 +178,14 @@ def normalize_defaults!(formatted)
end
end
- if options[:constraints].is_a?(Hash)
- options[:constraints].each do |key, default|
+ if options_constraints.is_a?(Hash)
+ options_constraints.each do |key, default|
if URL_OPTIONS.include?(key) && (String === default || Fixnum === default)
@defaults[key] ||= default
end
end
- elsif options[:constraints]
- verify_callable_constraint(options[:constraints])
+ elsif options_constraints
+ verify_callable_constraint(options_constraints)
end
if Regexp === formatted

0 comments on commit 3346d52

Please sign in to comment.