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::Application#config_for merges shared configuration deeply #37913

Merged

Conversation

@kirikiriyamama
Copy link
Contributor

kirikiriyamama commented Dec 8, 2019

Summary

I'm using some gems to manage environment specific configurations, but I'd like to migrate to the Rails features. However, my configurations are nested deeply, and Rails::Application#config_for doesn't merge deeply.

# config/application.yml
shared:
  foo:
    bar:
      baz: 1
development:
  foo:
    bar:
      qux: 2
# currently
config_for(:application)[:foo][:bar] #=> { qux: 2 }
# I expect
config_for(:application)[:foo][:bar] #=> { baz: 1, qux: 2 }

I know it's a breaking change. If changing the default behavior is difficult, for instance, how about controlling it by an option?

@rails-bot rails-bot bot added the railties label Dec 8, 2019
@rafaelfranca

This comment has been minimized.

Copy link
Member

rafaelfranca commented Dec 9, 2019

Can you add a CHANGELOG entry?

@kirikiriyamama

This comment has been minimized.

Copy link
Contributor Author

kirikiriyamama commented Dec 9, 2019

@rafaelfranca I've added it by 2b17c11

@rafaelfranca rafaelfranca merged commit 7c3e440 into rails:master Dec 9, 2019
2 checks passed
2 checks passed
build
Details
buildkite/rails Build #65423 passed (1 hour, 43 minutes, 36 seconds)
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.