diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-11-19 20:35:54 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-11-19 20:35:54 -0800 |
commit | 3d2bd6938586086fbce4d6c087e4f9cd528e0212 (patch) | |
tree | 6891c41144377be288179bff02e40b610f11821a /actionpack/lib/action_dispatch/routing/mapper.rb | |
parent | 24fa524cefb64208c424bda9e2fd80a9e4199629 (diff) | |
download | rails-3d2bd6938586086fbce4d6c087e4f9cd528e0212.tar.gz rails-3d2bd6938586086fbce4d6c087e4f9cd528e0212.tar.bz2 rails-3d2bd6938586086fbce4d6c087e4f9cd528e0212.zip |
Revert "copy options keys to the right place so that undo will work correctly"
This reverts commit 3178cc9a80262d3bf7754f3507ef60243b46634f.
Diffstat (limited to 'actionpack/lib/action_dispatch/routing/mapper.rb')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index e3ad3f9ba7..7947e9d393 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -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 |