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

Fix unitialized money_rails constant error #4851

Conversation

coalest
Copy link
Collaborator

@coalest coalest commented Dec 13, 2024

Doesn't resolve any issue.

Description

Error stack from someone experiencing it from Slack:

An error occurred while loading rails_helper.
Failure/Error: include MoneyRails::ActionViewExtension

NameError:
  uninitialized constant MoneyRails::ActionViewExtension
# ./app/helpers/items_helper.rb:3:in `<module:ItemsHelper>'
# ./app/helpers/items_helper.rb:2:in `<top (required)>'
# ./app/controllers/application_controller.rb:2:in `<top (required)>'
# ./config/application.rb:13:in `block in <class:Application>'
# ./config/environment.rb:5:in `<top (required)>'
# ./spec/rails_helper.rb:4:in `<top (required)>'

Seems to have occurred to two people in the past month. Let's add this just in case.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Not sure how to reproduce this error, I haven't been able to locally.
But looking at the stack trace, this should fix the issue as Rails initializers are loaded before that block in that to_prepare block in config/application.rb

@cielf cielf requested a review from dorner December 13, 2024 18:38
config/initializers/money.rb Outdated Show resolved Hide resolved
@coalest coalest requested a review from dorner December 16, 2024 13:23
Copy link
Collaborator

@dorner dorner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@dorner dorner merged commit 8f8d685 into rubyforgood:main Dec 18, 2024
11 checks passed
Copy link
Contributor

@coalest: Your PR Fix unitialized money_rails constant error is part of today's Human Essentials production release: 2024.12.22.
Thank you very much for your contribution!

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

Successfully merging this pull request may close these issues.

2 participants