diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2015-08-14 14:41:48 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2015-08-14 14:41:48 -0700 |
commit | 5ba6966766e67af4ae0028c4429acbd280a100a2 (patch) | |
tree | 2d7234541441879bc441a6cc046c1498ab20a203 /actionpack/lib/action_dispatch/routing/route_set.rb | |
parent | 68dd5abf1459e22ca64295ca3b4d6bcf2a525849 (diff) | |
download | rails-5ba6966766e67af4ae0028c4429acbd280a100a2.tar.gz rails-5ba6966766e67af4ae0028c4429acbd280a100a2.tar.bz2 rails-5ba6966766e67af4ae0028c4429acbd280a100a2.zip |
pass the mapping object to build_route
now that we aren't doing options manipulations, we can just pass the
mapping object down and read values from it.
Diffstat (limited to 'actionpack/lib/action_dispatch/routing/route_set.rb')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/route_set.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb index 04d8013768..df3b2bbc25 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, path_ast, requirements, defaults, name, anchor) + def add_route(mapping, path_ast, 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,11 +525,11 @@ module ActionDispatch "http://guides.rubyonrails.org/routing.html#restricting-the-routes-created" end - required_defaults = conditions.delete :required_defaults - path = build_path(path_ast, requirements, anchor) - conditions = build_conditions(conditions) + required_defaults = mapping.required_defaults + path = build_path(path_ast, mapping.requirements, anchor) + conditions = build_conditions(mapping.conditions) - route = @set.add_route(app, path, conditions, required_defaults, defaults, name) + route = @set.add_route(mapping.application, path, conditions, required_defaults, mapping.defaults, name) named_routes[name] = route if name route end |