aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2015-08-13 14:04:02 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2015-08-13 14:04:02 -0700
commitb778f6348bb5f00fc5fe8b6209c1a3f796126255 (patch)
treebe5fbfe2fccae0d049f1411813dd39c213222680 /actionpack
parente38a456faf6d4ab90c1ea7a3f9310ea47af35049 (diff)
downloadrails-b778f6348bb5f00fc5fe8b6209c1a3f796126255.tar.gz
rails-b778f6348bb5f00fc5fe8b6209c1a3f796126255.tar.bz2
rails-b778f6348bb5f00fc5fe8b6209c1a3f796126255.zip
remove `as`
the caller already has access to `as`, so we can stop passing it around.
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_dispatch/routing/mapper.rb15
-rw-r--r--actionpack/test/dispatch/mapper_test.rb2
2 files changed, 8 insertions, 9 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb
index 11f2e33b45..a2560e6704 100644
--- a/actionpack/lib/action_dispatch/routing/mapper.rb
+++ b/actionpack/lib/action_dispatch/routing/mapper.rb
@@ -59,15 +59,15 @@ module ActionDispatch
ANCHOR_CHARACTERS_REGEX = %r{\A(\\A|\^)|(\\Z|\\z|\$)\Z}
attr_reader :requirements, :conditions, :defaults
- attr_reader :to, :default_controller, :default_action, :as
+ attr_reader :to, :default_controller, :default_action
- def self.build(scope, set, path, as, controller, default_action, to, via, formatted, options)
+ def self.build(scope, set, path, controller, default_action, to, via, formatted, options)
options = scope[:options].merge(options) if scope[:options]
defaults = (scope[:defaults] || {}).dup
scope_constraints = scope[:constraints] || {}
- new set, path, defaults, as, controller, default_action, scope[:module], to, formatted, scope_constraints, scope[:blocks] || [], via, options
+ new set, path, defaults, controller, default_action, scope[:module], to, formatted, scope_constraints, scope[:blocks] || [], via, options
end
def self.check_via(via)
@@ -82,14 +82,13 @@ module ActionDispatch
via
end
- def initialize(set, path, defaults, as, controller, default_action, modyoule, to, formatted, scope_constraints, blocks, via, options)
+ def initialize(set, path, defaults, controller, default_action, modyoule, to, formatted, scope_constraints, blocks, via, options)
@defaults = defaults
@set = set
@to = to
@default_controller = controller
@default_action = default_action
- @as = as
options_constraints = options.delete(:constraints) || {}
@@ -131,7 +130,7 @@ module ActionDispatch
end
def to_route
- [ app(@blocks), conditions, requirements, defaults, as ]
+ [ app(@blocks), conditions, requirements, defaults ]
end
private
@@ -1610,8 +1609,8 @@ module ActionDispatch
name_for_action(options.delete(:as), action)
end
- mapping = Mapping.build(@scope, @set, URI.parser.escape(path), as, controller, default_action, to, via, formatted, options)
- app, conditions, requirements, defaults, as = mapping.to_route
+ mapping = Mapping.build(@scope, @set, URI.parser.escape(path), controller, default_action, to, via, formatted, options)
+ app, conditions, requirements, defaults = mapping.to_route
@set.add_route(app, conditions, requirements, defaults, as, anchor)
end
diff --git a/actionpack/test/dispatch/mapper_test.rb b/actionpack/test/dispatch/mapper_test.rb
index 8734380008..9a3a29b903 100644
--- a/actionpack/test/dispatch/mapper_test.rb
+++ b/actionpack/test/dispatch/mapper_test.rb
@@ -95,7 +95,7 @@ module ActionDispatch
def test_mapping_requirements
options = { }
scope = Mapper::Scope.new({})
- m = Mapper::Mapping.build(scope, FakeSet.new, '/store/:name(*rest)', nil, 'foo', 'bar', nil, [:get], nil, options)
+ m = Mapper::Mapping.build(scope, FakeSet.new, '/store/:name(*rest)', 'foo', 'bar', nil, [:get], nil, options)
_, _, requirements, _ = m.to_route
assert_equal(/.+?/, requirements[:rest])
end