aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/routing
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_dispatch/routing')
-rw-r--r--actionpack/lib/action_dispatch/routing/mapper.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb
index 1a9c843175..f1f4e389d6 100644
--- a/actionpack/lib/action_dispatch/routing/mapper.rb
+++ b/actionpack/lib/action_dispatch/routing/mapper.rb
@@ -60,7 +60,7 @@ module ActionDispatch
end
class Mapping #:nodoc:
- IGNORE_OPTIONS = [:defaults, :only, :except, :shallow, :shallow_path, :shallow_prefix]
+ IGNORE_OPTIONS = [:only, :except, :shallow, :shallow_path, :shallow_prefix]
ANCHOR_CHARACTERS_REGEX = %r{\A(\\A|\^)|(\\Z|\\z|\$)\Z}
attr_reader :scope, :options, :requirements, :conditions, :defaults
@@ -70,6 +70,9 @@ module ActionDispatch
@scope = scope
@requirements, @conditions, @defaults = {}, {}, {}
+ @defaults.merge!(scope[:defaults]) if scope[:defaults]
+ @defaults.merge!(options.delete(:defaults)) if options[:defaults]
+
options = scope[:options].merge(options) if scope[:options]
@to = options.delete :to
@default_controller = options[:controller] || scope[:controller]
@@ -170,9 +173,6 @@ module ActionDispatch
end
def normalize_defaults!(formatted, options_constraints)
- @defaults.merge!(scope[:defaults]) if scope[:defaults]
- @defaults.merge!(options[:defaults]) if options[:defaults]
-
options.each do |key, default|
unless Regexp === default || IGNORE_OPTIONS.include?(key)
@defaults[key] = default