aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch
diff options
context:
space:
mode:
authorAndy Jeffries <andy@andyjeffries.co.uk>2011-12-05 15:41:38 +0000
committerAndy Jeffries <andy@andyjeffries.co.uk>2011-12-05 15:41:38 +0000
commit71d769e3b58cb56b4b1d5143936c65be8b27c490 (patch)
treedeb3f2d6415373feeaaa3210ca4f49f0966b2aa6 /actionpack/lib/action_dispatch
parentd4964b338667fb14d7755cd90af88bb267238958 (diff)
downloadrails-71d769e3b58cb56b4b1d5143936c65be8b27c490.tar.gz
rails-71d769e3b58cb56b4b1d5143936c65be8b27c490.tar.bz2
rails-71d769e3b58cb56b4b1d5143936c65be8b27c490.zip
Named Routes shouldn't override existing ones (currently route recognition goes with the earliest match, named routes use the latest match)
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r--actionpack/lib/action_dispatch/routing/route_set.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb
index 2bcde16110..c64214431a 100644
--- a/actionpack/lib/action_dispatch/routing/route_set.rb
+++ b/actionpack/lib/action_dispatch/routing/route_set.rb
@@ -356,7 +356,7 @@ module ActionDispatch
conditions = build_conditions(conditions, valid_conditions, path.names.map { |x| x.to_sym })
route = @set.add_route(app, path, conditions, defaults, name)
- named_routes[name] = route if name
+ named_routes[name] = route if name && !named_routes[name]
route
end