diff options
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 4dda6d3101..afa90bda08 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -66,10 +66,9 @@ module ActionDispatch attr_reader :to, :default_controller, :default_action, :as, :anchor def initialize(scope, path, options) - @requirements, @conditions, @defaults = {}, {}, {} + @requirements, @conditions = {}, {} - @defaults.merge!(scope[:defaults]) if scope[:defaults] - @defaults.merge!(options.delete(:defaults)) if options[:defaults] + @defaults = (scope[:defaults] || {}).merge options.delete(:defaults) || {} options = scope[:options].merge(options) if scope[:options] @to = options.delete :to |