diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-09-12 15:48:03 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-09-12 16:50:49 -0700 |
commit | 943aa826a48c7db682e24f13cc93ed3298aa7e1a (patch) | |
tree | e978b30f85caddb51c6ae163d8de9ba3dbf97d9b /actionpack/lib/action_dispatch/routing/route_set.rb | |
parent | f5ab6805edbd72f752069d94d88003314e2a8a0a (diff) | |
download | rails-943aa826a48c7db682e24f13cc93ed3298aa7e1a.tar.gz rails-943aa826a48c7db682e24f13cc93ed3298aa7e1a.tar.bz2 rails-943aa826a48c7db682e24f13cc93ed3298aa7e1a.zip |
reduce dependencies of external objects in the Route class
Diffstat (limited to 'actionpack/lib/action_dispatch/routing/route_set.rb')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/route_set.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb index 21b720806c..dad4ecb27f 100644 --- a/actionpack/lib/action_dispatch/routing/route_set.rb +++ b/actionpack/lib/action_dispatch/routing/route_set.rb @@ -345,9 +345,9 @@ module ActionDispatch def add_route(app, conditions = {}, requirements = {}, defaults = {}, name = nil, anchor = true) raise ArgumentError, "Invalid route name: '#{name}'" unless name.blank? || name.to_s.match(/^[_a-z]\w*$/i) - route = Route.new(self, app, conditions, requirements, defaults, name, anchor) - path = route.conditions[:path_info] - route = @set.add_route(app, path, route.conditions, defaults, name) + foo = Route.new(valid_conditions, app, conditions, requirements, defaults, name, anchor) + path = foo.path + route = @set.add_route(app, path, foo.conditions, defaults, name) named_routes[name] = route if name route end |