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:
parent
24fa524cef
commit
3d2bd69385
1 changed files with 10 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue