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

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
Copy link
Member

Can you add a CHANGELOG entry?

@kirikiriyamama
Copy link
Contributor Author

@rafaelfranca I've added it by 2b17c11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants