diff options
| author | Aaron Patterson <aaron.patterson@gmail.com> | 2015-08-15 14:34:37 -0700 |
|---|---|---|
| committer | Aaron Patterson <aaron.patterson@gmail.com> | 2015-08-15 14:34:37 -0700 |
| commit | fe19d07138fe69e05ce8b17534c3c548a0a92575 (patch) | |
| tree | 9785a62bcc259bcdd98b349134ccbebacc99effc /actionpack/lib/action_dispatch/journey | |
| parent | 703275ba70efbefb3358052b6ba750443eff1a28 (diff) | |
| download | rails-fe19d07138fe69e05ce8b17534c3c548a0a92575.tar.gz rails-fe19d07138fe69e05ce8b17534c3c548a0a92575.tar.bz2 rails-fe19d07138fe69e05ce8b17534c3c548a0a92575.zip | |
move route allocation to a factory method on the mapping object
I would like to change the signature of the Route constructor. Since
the mapping object has all the data required to construct a Route
object, move the allocation to a factory method.
Diffstat (limited to 'actionpack/lib/action_dispatch/journey')
| -rw-r--r-- | actionpack/lib/action_dispatch/journey/routes.rb | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/actionpack/lib/action_dispatch/journey/routes.rb b/actionpack/lib/action_dispatch/journey/routes.rb index 4770b8b7cc..f7b009109e 100644 --- a/actionpack/lib/action_dispatch/journey/routes.rb +++ b/actionpack/lib/action_dispatch/journey/routes.rb @@ -61,14 +61,7 @@ module ActionDispatch end def add_route(name, mapping) - route = Route.new(name, - mapping.application, - mapping.path, - mapping.conditions, - mapping.required_defaults, - mapping.defaults) - - route.precedence = routes.length + route = mapping.make_route name, routes.length routes << route partition_route(route) clear_cache! |
