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

Rails 4.1 dev environment doesn't always reload durably decorated methods. #24

Open
JDutil opened this issue Jun 27, 2014 · 0 comments
Open

Comments

@JDutil
Copy link
Contributor

JDutil commented Jun 27, 2014

Sorry I don't have a specific example to replicate the issue at the moment, but will update if I get one in a non-client project.

We've run into a bug where occasionally methods wrapped in durably_decorate don't get reloaded in dev environment with how Rails 4.1 is eager loading models. This results in durably_decorated methods to get ignored when the model is reloaded.

So for example we had decorated devise controller authentication to require people to enter their password if it's been more than 15 minutes since they last entered it similar to Amazon. Things work great having durably_decorated the authentication method, but then after awhile all of the sudden the decorated method is no longer executed and the original behavior takes over again. Once you restart the web server the decorator is picked up again and continues working fine for awhile. Then stops again. Removing durably_decorate and simply overriding the method in the decorator appears to resolve the problem from occurring anymore.

I think this may be related to Rails 4.1.x now using spring or changes to the eager loading process for dev environment. The problem doesn't happen in production environment at all so it seems to be an issue with durable decorator not getting executed whenever a class gets reloaded during dev.

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