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

It does not appear to be reloading the code on changes #35618

Closed
fxn opened this issue Mar 15, 2019 · 1 comment
Closed

It does not appear to be reloading the code on changes #35618

fxn opened this issue Mar 15, 2019 · 1 comment
Assignees
Milestone

Comments

@fxn
Copy link
Member

fxn commented Mar 15, 2019

Issue reported by @cj, moved from fxn/zeitwerk#21.

This issue is in reference to fxn/zeitwerk#19 (comment).

Adding code to a controller once the server has loaded does not get executed/updated.

Steps to reproduce:

Expected outcome:

  • print foo to the console

Current work around:

  • add config.autoloader = :classic to config/application.rb

Screencast demonstrating issue:

https://cl.ly/577db63e745a


@fxn here is the Zeitwerk trace https://gist.github.com/cj/ffc8b578412034cebdd410bf534e4ab0

@fxn fxn self-assigned this Mar 15, 2019
@fxn
Copy link
Member Author

fxn commented Mar 15, 2019

The explanation is that the default superclass of Devise controllers is ApplicationController, and ultimately configurable by the user.

Since the current Zeitwerk integration does not reload engines if loaded as gems, Devise controllers do not get refreshed, and therefore after a reload their parent remains to be the (stale) class object stored in the original constant.

I believe this invalidates that optimization.

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

No branches or pull requests

1 participant