diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-11-23 20:00:25 -0200 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-11-24 09:19:21 -0200 |
commit | 2b64e9b1bde13783ddca55dbf27e36c9c35364b2 (patch) | |
tree | a0b7351a7fd93ee6da7c3b4085f49386ed26ac83 | |
parent | beeb9529b8be771830fcc488aa73cee2d9f8e40b (diff) | |
download | rails-2b64e9b1bde13783ddca55dbf27e36c9c35364b2.tar.gz rails-2b64e9b1bde13783ddca55dbf27e36c9c35364b2.tar.bz2 rails-2b64e9b1bde13783ddca55dbf27e36c9c35364b2.zip |
Simplify scope options recovery by using merge!
Instead of iterating again over the options and setting one by one, we
can just merge the recover hash back to the scope one since all keys
match.
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 567a014060..66b7963eaf 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -669,12 +669,7 @@ module ActionDispatch yield self ensure - scope_options.each do |option| - @scope[option] = recover[option] if recover.has_key?(option) - end - - @scope[:options] = recover[:options] - @scope[:blocks] = recover[:blocks] + @scope.merge!(recover) end # Scopes routes to a specific controller |