Skip to content
Browse files

change defaults allocation to a one-liner

  • Loading branch information...
1 parent d00bbe6 commit 4d3955aef459a5a303112e98f2f075753fc90e8c @tenderlove tenderlove committed May 30, 2014
Showing with 2 additions and 3 deletions.
  1. +2 −3 actionpack/lib/action_dispatch/routing/mapper.rb
View
5 actionpack/lib/action_dispatch/routing/mapper.rb
@@ -66,10 +66,9 @@ class Mapping #:nodoc:
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

0 comments on commit 4d3955a

Please sign in to comment.
Something went wrong with that request. Please try again.