Permalink
Browse files

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.
  • Loading branch information...
1 parent beeb952 commit 2b64e9b1bde13783ddca55dbf27e36c9c35364b2 @carlosantoniodasilva carlosantoniodasilva committed Nov 23, 2012
Showing with 1 addition and 6 deletions.
  1. +1 −6 actionpack/lib/action_dispatch/routing/mapper.rb
View
7 actionpack/lib/action_dispatch/routing/mapper.rb
@@ -669,12 +669,7 @@ def scope(*args)
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

0 comments on commit 2b64e9b

Please sign in to comment.