diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-07-26 17:45:34 -0700 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2011-08-13 16:22:19 -0700 |
commit | a704fd4ea9b8ac86f57d357bd8e2a555b69edca9 (patch) | |
tree | a2cb063f4ee43034c5eeabe545aebcaa6c848973 | |
parent | f445bb26715406a5718bbf4652bbfa4d8be0b60d (diff) | |
download | rails-a704fd4ea9b8ac86f57d357bd8e2a555b69edca9.tar.gz rails-a704fd4ea9b8ac86f57d357bd8e2a555b69edca9.tar.bz2 rails-a704fd4ea9b8ac86f57d357bd8e2a555b69edca9.zip |
use regular ruby rather than clever ruby
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index ee4d405ce7..187e2a8a74 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -105,13 +105,13 @@ module ActionDispatch # controllers with default routes like :controller/:action/:id(.:format), e.g: # GET /admin/products/show/1 # => { :controller => 'admin/products', :action => 'show', :id => '1' } - @options.reverse_merge!(:controller => /.+?/) + @options[:controller] ||= /.+?/ end # Add a constraint for wildcard route to make it non-greedy and match the # optional format part of the route by default if path.match(WILDCARD_PATH) && @options[:format] != false - @options.reverse_merge!(:"#{$1}" => /.+?/) + @options[$1.to_sym] ||= /.+?/ end if @options[:format] == false @@ -264,7 +264,7 @@ module ActionDispatch # because this means it will be matched first. As this is the most popular route # of most Rails applications, this is beneficial. def root(options = {}) - match '/', options.reverse_merge(:as => :root) + match '/', { :as => :root }.merge(options) end # Matches a url pattern to one or more routes. Any symbols in a pattern |