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

Money-Rails can break configuration via initializers #711

Open
hellosweta opened this issue Jan 10, 2025 · 0 comments
Open

Money-Rails can break configuration via initializers #711

hellosweta opened this issue Jan 10, 2025 · 0 comments

Comments

@hellosweta
Copy link

We're having an issue where on upgrade to Rails 7.1, some configs from our new_framework_defaults files are being overridden.

Our guess is since money-rails references ActiveRecord::Base while it is loading (see hooks.rb), it triggers the on_load event (see active_record/railtie.rb in Rails itself), which transmutes all the existing config settings into ActiveRecord::Base.

Rails will only call the on_load event once, and because it happens before any initializers have been read, this means that any configuration of ActiveRecord in an initializer that takes place via the Rails.application.config.active_record object is essentially ignored when we use this gem.

We noticed other gems with this issue like here: norman/friendly_id#823

Is this something you would consider fixing? (we're on version 1.15.0)

Thanks!
Sweta

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