New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rails 4 upgrade notes about clashing named route selection changes #9690
Conversation
/cc @fxn |
👍 |
I'd like to log a warning when a route is skipped here: https://github.com/rails/rails/blob/master/actionpack/lib/action_dispatch/journey/routes.rb#L61 I'm not sure how best to do that, though -- @steveklabnik or @carlosantoniodasilva have any ideas? |
@trevorturk this is what comes up to my mind right now: if name
if named_routes[name]
ActiveSupport::Deprecation.warn("BOOM")
else
named_routes[name] = route
end
end It could be moved to a private method like |
Yeah, I was thinking using Want to work something up, or shall I? |
Hm right, I guess we should not use AS::Deprecation, it's probably better to use |
@carlosantoniodasilva took a stab at it in #9704 -- worked nicely in my local testing. If we go ahead with that, I'd like to update this PR to mention the logging -- much easier than trying to read through the |
👍 on this, any other concerns we need to address before merging in this doc addition? |
IMO it's good to go -- I made a separate PR #9704 where we can discuss logging or any other helpful stuff we might consider doing. If we go ahead with that, I'll update this section as well. |
Rails 4 upgrade notes about clashing named route selection changes
Thank you |
❤️ |
Document change to clashing named route selection. Rails 4 correctly prefers the first named route. (Likely from rails/journey@98a9802)