Thanks a lot for fixing #4164 ...
now there's a new problem, illustrated in the updated app at:
Here are my routes, roughly lifted from my actual app:
match 'purchase/:product_id' => 'purchases#new', :as => :new_purchase
match 'purchase/:product_id' => 'purchases#new', :as => :correct_new_purchase
Here is the test that fails:
assert_equal correct_new_purchase_url(products(:one)), new_purchase_url(products(:one))
<"http://test.host/purchase/980190962"> expected but was
So the URL because purchase.:product_id instead of purchase/:product_id.
No idea why.
Happy new year, you fine people! :)
Looks like this is due to 71d769e. Basically a similar issue to #4164 where the same named route is being defined multiple times. I'll revert that commit on 3-2-stable, but it will remain on master as the rule should be "first one wins".
This is fixed in e912211 and 63f7a61
Thanks, Aaron. Confirmed fixed.
When generating routes, the last defined named route wins. This is in
contrast to route recognition where the first recognized route wins.
This behavior will not exist in Rails 4.0.