1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Revert "copy options keys to the right place so that undo will work correctly"

This reverts commit 3178cc9a80.
This commit is contained in:
Aaron Patterson 2011-11-19 20:35:54 -08:00
parent 24fa524cef
commit 3d2bd69385

View file

@ -603,12 +603,9 @@ module ActionDispatch
options[:constraints] ||= {}
unless options[:constraints].is_a?(Hash)
options[:blocks] = options[:constraints]
options[:constraints] = {}
block, options[:constraints] = options[:constraints], {}
end
options[:options] = options
scope_options.each do |option|
if value = options.delete(option)
recover[option] = @scope[option]
@ -616,12 +613,21 @@ module ActionDispatch
end
end
recover[:block] = @scope[:blocks]
@scope[:blocks] = merge_blocks_scope(@scope[:blocks], block)
recover[:options] = @scope[:options]
@scope[:options] = merge_options_scope(@scope[:options], options)
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[:block]
end
# Scopes routes to a specific controller