Skip to content
Browse files

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

  • Loading branch information...
1 parent ecbae99 commit 3178cc9a80262d3bf7754f3507ef60243b46634f @tenderlove tenderlove committed Oct 21, 2011
Showing with 4 additions and 10 deletions.
  1. +4 −10 actionpack/lib/action_dispatch/routing/mapper.rb
View
14 actionpack/lib/action_dispatch/routing/mapper.rb
@@ -603,31 +603,25 @@ def scope(*args)
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]
@scope[option] = send("merge_#{option}_scope", @scope[option], value)
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

2 comments on commit 3178cc9

@rubys
rubys commented on 3178cc9 Nov 19, 2011

This change causes assert_recognizes, assert_generates, and assert_routing to fail on Ruby 1.8.7.

Expected output (as seen on Ruby 1.9.3) vs Actual output (when using Ruby 1.8.7)

@jonleighton
Ruby on Rails member

CI failing also (just pointing out in case that provides easier test cases to find the problem)

Please sign in to comment.
Something went wrong with that request. Please try again.