From 71d769e3b58cb56b4b1d5143936c65be8b27c490 Mon Sep 17 00:00:00 2001 From: Andy Jeffries Date: Mon, 5 Dec 2011 15:41:38 +0000 Subject: Named Routes shouldn't override existing ones (currently route recognition goes with the earliest match, named routes use the latest match) --- actionpack/lib/action_dispatch/routing/route_set.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib/action_dispatch') 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 -- cgit v1.2.3