Permalink
Browse files

Mapping never actually uses @set, so rm

  • Loading branch information...
1 parent be137b0 commit 74b73f132aab596ce509082fdf2b0e9dd4226e9c @tenderlove tenderlove committed May 29, 2014
Showing with 4 additions and 4 deletions.
  1. +3 −3 actionpack/lib/action_dispatch/routing/mapper.rb
  2. +1 −1 actionpack/test/dispatch/mapper_test.rb
@@ -66,8 +66,8 @@ class Mapping #:nodoc:
attr_reader :scope, :options, :requirements, :conditions, :defaults
attr_reader :to, :default_controller, :default_action
- def initialize(set, scope, path, options)
- @set, @scope = set, scope
+ def initialize(scope, path, options)
+ @scope = scope
@requirements, @conditions, @defaults = {}, {}, {}
options = scope[:options].merge(options) if scope[:options]
@@ -1515,7 +1515,7 @@ def add_route(action, options) # :nodoc:
options[:as] = name_for_action(options[:as], action)
end
- mapping = Mapping.new(@set, @scope, URI.parser.escape(path), options)
+ mapping = Mapping.new(@scope, URI.parser.escape(path), options)
app, conditions, requirements, defaults, as, anchor = mapping.to_route
@set.add_route(app, conditions, requirements, defaults, as, anchor)
end
@@ -38,7 +38,7 @@ def test_initialize
def test_mapping_requirements
options = { :controller => 'foo', :action => 'bar', :via => :get }
- m = Mapper::Mapping.new FakeSet.new, {}, '/store/:name(*rest)', options
+ m = Mapper::Mapping.new({}, '/store/:name(*rest)', options)
_, _, requirements, _ = m.to_route
assert_equal(/.+?/, requirements[:rest])
end

0 comments on commit 74b73f1

Please sign in to comment.