diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-05-30 13:58:00 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-06-03 11:33:52 -0700 |
commit | 4d3955aef459a5a303112e98f2f075753fc90e8c (patch) | |
tree | f5b6e6b0468cb1cf41bfe0d66eb481a85e8106ce /actionpack | |
parent | d00bbe64aea227df44729f5ea522e2a0462a0797 (diff) | |
download | rails-4d3955aef459a5a303112e98f2f075753fc90e8c.tar.gz rails-4d3955aef459a5a303112e98f2f075753fc90e8c.tar.bz2 rails-4d3955aef459a5a303112e98f2f075753fc90e8c.zip |
change defaults allocation to a one-liner
Diffstat (limited to 'actionpack')
-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 |