aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-10-21 16:47:49 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2011-11-18 10:51:11 -0800
commit3178cc9a80262d3bf7754f3507ef60243b46634f (patch)
treeda653c2275c2930f0043f4b949ae076c9ddf1c9a /actionpack/lib/action_dispatch
parentecbae9947830bb3ec42db097140bf1b2154dee31 (diff)
downloadrails-3178cc9a80262d3bf7754f3507ef60243b46634f.tar.gz
rails-3178cc9a80262d3bf7754f3507ef60243b46634f.tar.bz2
rails-3178cc9a80262d3bf7754f3507ef60243b46634f.zip
copy options keys to the right place so that undo will work correctly
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r--actionpack/lib/action_dispatch/routing/mapper.rb14
1 files changed, 4 insertions, 10 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb
index f2a2e92011..21624bcfc2 100644
--- a/actionpack/lib/action_dispatch/routing/mapper.rb
+++ b/actionpack/lib/action_dispatch/routing/mapper.rb
@@ -603,9 +603,12 @@ module ActionDispatch
options[:constraints] ||= {}
unless options[:constraints].is_a?(Hash)
- block, options[:constraints] = options[:constraints], {}
+ options[:blocks] = options[:constraints]
+ options[:constraints] = {}
end
+ options[:options] = options
+
scope_options.each do |option|
if value = options.delete(option)
recover[option] = @scope[option]
@@ -613,21 +616,12 @@ 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