mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Revert "copy options keys to the right place so that undo will work correctly"
This reverts commit 3178cc9a80.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user