From 2b64e9b1bde13783ddca55dbf27e36c9c35364b2 Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Fri, 23 Nov 2012 20:00:25 -0200 Subject: 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. --- actionpack/lib/action_dispatch/routing/mapper.rb | 7 +------ 1 file changed, 1 insertion(+), 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 -- cgit v1.2.3