diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-05-30 11:40:17 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-06-03 11:33:51 -0700 |
commit | 3346d52248877105f57345f51de68322fa7b1ac1 (patch) | |
tree | 0f6a2ffe1243bc26b10d54fac4f291ac87da9576 /actionpack | |
parent | 496e25aab777c5ee5d02d08973125467f0a19cdc (diff) | |
download | rails-3346d52248877105f57345f51de68322fa7b1ac1.tar.gz rails-3346d52248877105f57345f51de68322fa7b1ac1.tar.bz2 rails-3346d52248877105f57345f51de68322fa7b1ac1.zip |
disconnect normalize_defaults! from options[:constraints]
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index d6d42413a3..0852bd07a6 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -91,7 +91,7 @@ module ActionDispatch 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 @@ module ActionDispatch 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 @@ module ActionDispatch 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 |