-
-
Notifications
You must be signed in to change notification settings - Fork 235
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
Overloading with nulls #13
Comments
The reason this is happening is this gem vendor'ed the deep_merge gem vendor/deep_merge.rb:72 As you can see it will just skip over any overrides that are false or blank. IMHO this is incorrect and has been fixed in the original gem located here. https://github.com/danielsdeleo/deep_merge I just added this dependency to my Gemfile and rails_config will just use the loaded gem instead of the vendored version. |
Cool, thanks! |
Hello, What's the status of this issue? It's still occurring and overriding with a blank value doesn't affect the original value. Thanks! |
There is an open PR on deep merge gem: danielsdeleo/deep_merge#20 |
I made a mistake. In fact, danielsdeleo/deep_merge#33 solves this issue, not danielsdeleo/deep_merge#20 |
danielsdeleo/deep_merge#33 was merged and released in deep_merge 1.2.0+. Fixes rubyconfig#13
danielsdeleo/deep_merge#33 was merged and released in deep_merge 1.2.0+. Fixes rubyconfig#13
danielsdeleo/deep_merge#33 was merged and released in deep_merge 1.2.0+. Fixes rubyconfig#13
Previously, if you merged in {a: nil}, it would not overwrite an existing value. In rubyconfig#13, this was found to be an undesirable default behavior. Now, we will merge nil values by default. You can retain the old behavior via `config.merge_nil_values = false` in your Config initializer. This required changes to deep merge, found in: danielsdeleo/deep_merge#33 This was released in deep_merge 1.2.0+. Fixes rubyconfig#13
Previously, if you merged in {a: nil}, it would not overwrite an existing value. In rubyconfig#13, this was found to be an undesirable default behavior. Now, we will merge nil values by default. You can retain the old behavior via `config.merge_nil_values = false` in your Config initializer. This required changes to deep merge, found in: danielsdeleo/deep_merge#33 This was released in deep_merge 1.2.0+. Fixes rubyconfig#13
Previously, if you merged in {a: nil}, it would not overwrite an existing value. In rubyconfig#13, this was found to be an undesirable default behavior. Now, we will merge nil values by default. You can retain the old behavior via `config.merge_nil_values = false` in your Config initializer. This required changes to deep merge, found in: danielsdeleo/deep_merge#33 This was released in deep_merge 1.2.0+. Fixes rubyconfig#13
Previously, if you merged in {a: nil}, it would not overwrite an existing value. In rubyconfig#13, this was found to be an undesirable default behavior. Now, we will merge nil values by default. You can retain the old behavior via `config.merge_nil_values = false` in your Config initializer. This required changes to deep merge, found in: danielsdeleo/deep_merge#33 This was released in deep_merge 1.2.0+. Fixes rubyconfig#13
Previously, if you merged in {a: nil}, it would not overwrite an existing value. In rubyconfig#13, this was found to be an undesirable default behavior. Now, we will merge nil values by default. You can retain the old behavior via `config.merge_nil_values = false` in your Config initializer. This required changes to deep merge, found in: danielsdeleo/deep_merge#33 This was released in deep_merge 1.2.0+. Fixes rubyconfig#13
Previously, if you merged in {a: nil}, it would not overwrite an existing value. In rubyconfig#13, this was found to be an undesirable default behavior. Now, we will merge nil values by default. You can retain the old behavior via `config.merge_nil_values = false` in your Config initializer. This required changes to deep merge, found in: danielsdeleo/deep_merge#33 This was released in deep_merge 1.2.0+. Fixes rubyconfig#13
Previously, if you merged in {a: nil}, it would not overwrite an existing value. In rubyconfig#13, this was found to be an undesirable default behavior. Now, we will merge nil values by default. You can retain the old behavior via `config.merge_nil_values = false` in your Config initializer. This required changes to deep merge, found in: danielsdeleo/deep_merge#33 This was released in deep_merge 1.2.0+. Fixes rubyconfig#13
I was expecting to be able to "unset" a property in an overriding config file. For example, consider the following:
In
config/settings.yml
name: Admin
email: [email protected]
In
config/settings/development.yml
name: Nobody
email: null
However, it looks like instead of unsetting the value, the derived property is untouched.
That is, the above case yields:
Settings.name # => Nobody
Settings.email # => [email protected]
Rather than what I was expecting:
Settings.name # => Nobody
Settings.email # => nil
Bug, or feature?
The text was updated successfully, but these errors were encountered: