Skip to content
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

Fix initializer autoloading in Rails 7 #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

m1foley
Copy link

@m1foley m1foley commented Sep 28, 2023

This was causing problems when I attempted to upgrade to Rails 7: my ApplicationController references some code that doesn't get loaded until Rails has been initialized, and this engine was attempting to load ApplicationController before Rails is initialized. This resulted in the code not being found. Wrapping it in a to_prepare block fixed the problem. I think this wasn't an issue in Rails 6 because the Zeitwork autoloader is strictly enforced in Rails 7.

This also fixes a Rubocop being disabled and not re-enabled afterward.

This was causing problems when I attempted to upgrade to Rails 7: my
`ApplicationController` references some code that doesn't get loaded
until Rails has been initialized, and this engine was attempting to load
`ApplicationController` before Rails is initialized. This resulted in
the code not being found. Wrapping it in a `to_prepare` block fixed the
problem.

This also fixes a Rubocop being disabled and not re-enabled afterward.
@wagenet
Copy link

wagenet commented Jan 10, 2024

@m1foley Unfortunately, I've changed jobs and no longer am working on this project. It seems like possibly no one else is either. If you or anyone else have interest in taking ownership, please let me know.

@m1foley
Copy link
Author

m1foley commented Jan 11, 2024

Thanks. I am no longer using this project, so I wouldn't be a good maintainer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants