diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2015-08-17 16:07:39 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2015-08-17 16:08:39 -0700 |
commit | 1ce74b009f0a5bbb9e5f5fe1c037c77437fd0be9 (patch) | |
tree | 329bc9c0c1c6edc9ae1ab4b90969c765fdfbbb17 /actionpack/lib/action_dispatch | |
parent | 559e7f94506ac3c3e8553f9510f43923e7c804da (diff) | |
download | rails-1ce74b009f0a5bbb9e5f5fe1c037c77437fd0be9.tar.gz rails-1ce74b009f0a5bbb9e5f5fe1c037c77437fd0be9.tar.bz2 rails-1ce74b009f0a5bbb9e5f5fe1c037c77437fd0be9.zip |
introduce an alternate constructor for Route objects
I want to change the real constructor to take a particular parameter for
matching the request method
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r-- | actionpack/lib/action_dispatch/journey/route.rb | 4 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/journey/route.rb b/actionpack/lib/action_dispatch/journey/route.rb index f9e0e360c3..d44c3d31d7 100644 --- a/actionpack/lib/action_dispatch/journey/route.rb +++ b/actionpack/lib/action_dispatch/journey/route.rb @@ -8,6 +8,10 @@ module ActionDispatch attr_accessor :precedence + def self.build(name, app, path, constraints, required_defaults, defaults) + new name, app, path, constraints, required_defaults, defaults + end + ## # +path+ is a path constraint. # +constraints+ is a hash of constraints to be applied to this route. diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 2c9cab605f..e964bf59e0 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -144,7 +144,7 @@ module ActionDispatch end def make_route(name, precedence) - route = Journey::Route.new(name, + route = Journey::Route.build(name, application, path, conditions, |