diff options
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index f4f34e7924..bcc0e6fe9f 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -121,14 +121,13 @@ module ActionDispatch @requirements = formats[:requirements].merge Hash[requirements] @conditions = Hash[conditions] - @defaults = formats[:defaults].merge @defaults + @defaults = formats[:defaults].merge(@defaults).merge(normalize_defaults(options)) @conditions[:required_defaults] = (split_options[:required_defaults] || []).map(&:first) @conditions[:path_info] = path @conditions[:parsed_path_info] = ast add_request_method(via, @conditions) - normalize_defaults!(options) end def to_route @@ -219,12 +218,8 @@ module ActionDispatch end end - def normalize_defaults!(options) - options.each_pair do |key, default| - unless Regexp === default - @defaults[key] = default - end - end + def normalize_defaults(options) + Hash[options.reject { |_, default| Regexp === default }] end def add_request_method(via, conditions) |