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 for Rails 6: Zeitwerk class loading #37

Open
wants to merge 1 commit into
base: master
from

Conversation

@matugm
Copy link

commented Sep 14, 2019

We have reports on this gem not working in Rails 6.

I looked into this & it seems like controllers aren't loaded with @all.eager_load! because of the new class autoloader, Zeitwerk.

This code, from Rails 6 eager_load!, shows that if Zeitwerk is enabled (default in Rails 6), then it returns & does nothing.

Calling Zeitwerk::Loader.eager_load_all fixes that.

@matugm matugm changed the title Fix for Rails 6: Zeitwerk class loading (Fix #36) Fix for Rails 6: Zeitwerk class loading (#36) Sep 14, 2019
@matugm matugm changed the title Fix for Rails 6: Zeitwerk class loading (#36) Fix for Rails 6: Zeitwerk class loading Sep 14, 2019
@amatsuda

This comment has been minimized.

Copy link
Owner

commented Sep 14, 2019

Thank you for the patch and detailed report!
But for now I'd like to see how this issue is treated upstream: rails/rails#37045

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.