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/routing/mapper.rb | |
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/routing/mapper.rb')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index f82c3c0d34..a9dae77e51 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -143,6 +143,18 @@ module ActionDispatch @required_defaults = (split_options[:required_defaults] || []).map(&:first) end + def make_route(name, precedence) + route = Journey::Route.new(name, + application, + path, + conditions, + required_defaults, + defaults) + + route.precedence = precedence + route + end + def application app(@blocks) end |