aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/routing/route_set.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2015-08-14 10:44:49 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2015-08-14 10:44:49 -0700
commitb592c5b607e4879c0b603bf636cf6d11e9f4b8d2 (patch)
tree8bdc00f903c4648b9ec3a40c64419b1dc9c7a7f6 /actionpack/lib/action_dispatch/routing/route_set.rb
parentaaaa67902ee1d129a6907e4ebd726f383ad7002b (diff)
downloadrails-b592c5b607e4879c0b603bf636cf6d11e9f4b8d2.tar.gz
rails-b592c5b607e4879c0b603bf636cf6d11e9f4b8d2.tar.bz2
rails-b592c5b607e4879c0b603bf636cf6d11e9f4b8d2.zip
pass the path ast down
now we don't need to add it to a hash and delete it from the hash later just to pass it around
Diffstat (limited to 'actionpack/lib/action_dispatch/routing/route_set.rb')
-rw-r--r--actionpack/lib/action_dispatch/routing/route_set.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb
index a3cadec68f..04d8013768 100644
--- a/actionpack/lib/action_dispatch/routing/route_set.rb
+++ b/actionpack/lib/action_dispatch/routing/route_set.rb
@@ -514,7 +514,7 @@ module ActionDispatch
routes.empty?
end
- def add_route(app, conditions, requirements, defaults, name, anchor)
+ def add_route(app, conditions, path_ast, requirements, defaults, name, anchor)
raise ArgumentError, "Invalid route name: '#{name}'" unless name.blank? || name.to_s.match(/^[_a-z]\w*$/i)
if name && named_routes[name]
@@ -525,9 +525,8 @@ module ActionDispatch
"http://guides.rubyonrails.org/routing.html#restricting-the-routes-created"
end
- ast = conditions.delete :parsed_path_info
required_defaults = conditions.delete :required_defaults
- path = build_path(ast, requirements, anchor)
+ path = build_path(path_ast, requirements, anchor)
conditions = build_conditions(conditions)
route = @set.add_route(app, path, conditions, required_defaults, defaults, name)