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
Re-define _routes when not set correctly via inheritance #41463
Merged
jhawthorn
merged 2 commits into
rails:main
from
jhawthorn:isolated_engine_controller_subclasses
Feb 16, 2021
Merged
Re-define _routes when not set correctly via inheritance #41463
jhawthorn
merged 2 commits into
rails:main
from
jhawthorn:isolated_engine_controller_subclasses
Feb 16, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jhawthorn
changed the title
Isolated engine controller subclasses
Re-define _routes when not set correctly via inheritance
Feb 16, 2021
This fixes an regression where _routes were set incorrectly when the inheritance chain went from one route namespace (isolated engine or main app) to another and then back to the original. Because the url_helpers module was being cached and was being re-included this was not setting _routes. This commit solves the issue by detecting that case and redefining _routes in that case. We could have always performed the redefinition, but it's a pretty uncommon case, so we might as well only do it when necessary.
jhawthorn
force-pushed
the
isolated_engine_controller_subclasses
branch
from
February 16, 2021 19:55
cd402ce
to
715d6bc
Compare
rafaelfranca
approved these changes
Feb 16, 2021
eileencodes
approved these changes
Feb 16, 2021
jhawthorn
added a commit
that referenced
this pull request
Feb 16, 2021
…ubclasses Re-define _routes when not set correctly via inheritance
Backported to |
Thanks! I’m glad you found a simpler means than #40264 to inserting the extra module, it felt a little janky. |
This was referenced Mar 8, 2021
This was referenced Mar 15, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes a regression where
_routes
were set incorrectly when the inheritance chain went from one route namespace (isolated engine or main app) to another and then back to the original. Because theurl_helpers
module was being cached and was being re-included this was not setting_routes
.This commit solves the issue by detecting that case and redefining
_routes
in that case. We could have always performed the redefinition, but it's a pretty uncommon case, so we might as well only do it when necessary.Fixes #40263 (includes that commit)
Fixes #40264
Fixes #41458
Fixes #41038
cc @vtamara @inopinatus