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

already initialized constant in view helper modules #865

Open
blarralde opened this issue Oct 8, 2019 · 0 comments
Open

already initialized constant in view helper modules #865

blarralde opened this issue Oct 8, 2019 · 0 comments

Comments

@blarralde
Copy link

Rails 6.0.0
Draper 3.1.0

Steps to reproduce:

  • in a view helper (under app/helpers) add a constant like MY_CONSTANT = 'const'
  • restart the rails server

Buggy behavior:

/app/helpers/test_helper.rb:2: warning: already initialized constant TestHelper::MY_CONSTANT
app/helpers/test_helper.rb:2: warning: previous definition of MY_CONSTANT was here

This seems to be due to draper loading all the helpers so it can use the h method, and then zeitwerk autoloading everything again (or the other way, I'm not sure).

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