aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-12-05 08:48:25 -0800
committerJosé Valim <jose.valim@gmail.com>2011-12-05 08:48:25 -0800
commitf6cc4fd7a251490df717a85be3be335a70edaec5 (patch)
tree7c5ba7332ced3ff0e2f24192f7d8f7b21d75ddbf /actionpack/lib
parent168c088735d47ecb4347541afcbf4a873f50319a (diff)
parent71d769e3b58cb56b4b1d5143936c65be8b27c490 (diff)
downloadrails-f6cc4fd7a251490df717a85be3be335a70edaec5.tar.gz
rails-f6cc4fd7a251490df717a85be3be335a70edaec5.tar.bz2
rails-f6cc4fd7a251490df717a85be3be335a70edaec5.zip
Merge pull request #3861 from andyjeffries/master
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')
-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