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

Merit being initialised once with Rails 5.2 and release 3.0.1 but for API and not Web app. #296

Closed
jamesjefferies opened this issue Jun 28, 2018 · 2 comments

Comments

@jamesjefferies
Copy link
Contributor

The application I'm working on had an issue with Rails 5.2 and Release 3.0.1 where merit was being initialised once for the API set up, and then consequently not for the actual application set up. Consequently Merit doesn't work using the web infrastructure.

Without the run_once, it does work, but of course you get the warning errors about Merit already being initialised!

If I get chance, I'll try and build an example application, but the fix which works (for me!) would be to change the ActiveSupport.on_load trigger from :action_controller which is used by the API and standard Rails infrastructure to a more specific :action_controller_base

i.e.

ActiveSupport.on_load(:action_controller_base, run_once: true) do

This tightening of action controller loading is detailed a bit more here:

rails/rails#28402

@tute
Copy link
Member

tute commented Jun 28, 2018

I believe that's the PR @truongnmt will contribute. Thanks for the context and help debugging!

@tute
Copy link
Member

tute commented Jun 29, 2018

Closing in favor of your PR. Thank you James! 🎉

@tute tute closed this as completed Jun 29, 2018
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

2 participants