-
Notifications
You must be signed in to change notification settings - Fork 46
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
Constant unloaded but not using latest version after refresh #54
Comments
Hey @frobichaud, thanks for reporting this. I'm reasonably certain your issue stems from Rails routes keeping a reference to a now stale The detection mechanism is fragile and will not work, if for example Rails itself deals with this problem by re-evaluating Can you also try this new branch gem 'rails-dev-boost', :github => 'thedarkone/rails-dev-boost', :branch => 'routes-and-boot-time-consts' Please report back if the branch or the flag toggle helps! |
ping @frobichaud, any chance you had a look at this? |
@thedarkone I finally got the chance to try all your propositions but I had no luck. My API code does not reload on change. |
Hi,
I'm using Grape to serve an API with Rails 4 and my config looks like this:
application.rb:
config.paths.add File.join('app', 'api'), glob: File.join('', '.rb')
config.autoload_paths += Dir[Rails.root.join('app', 'api', '')]
My project structure is
We mount grape in routes.rb as follow:
When debugging rails-dev-boost, I can see notification_api.rb being loaded in the constants.
If I modify the file, and perform another request, the debug! shows:
But the code being executed is still the old one. I debugged the gem and went through the code where my constant was removed.
If I perform a second modification and another request, the constant is not loaded, and debug! shows:
So it looks like my NotificationApi is autoloaded fine at the start, it is unloaded on the first modification but never reloaded again.
@thedarkone, can you see something wrong in my setup?
The text was updated successfully, but these errors were encountered: