README.md in config-1.6.1 vs README.md in config-1.7.0

- old
+ new

@@ -1,13 +1,12 @@ # Config [![Build Status](https://api.travis-ci.org/railsconfig/config.svg?branch=master)](http://travis-ci.org/railsconfig/config) [![Gem Version](https://badge.fury.io/rb/config.svg)](http://badge.fury.io/rb/config) [![Dependency Status](https://gemnasium.com/railsconfig/config.svg)](https://gemnasium.com/railsconfig/config) -[![Code Climate](https://codeclimate.com/github/railsconfig/config/badges/gpa.svg)](https://codeclimate.com/github/railsconfig/config) -[![Issue Count](https://codeclimate.com/github/railsconfig/config/badges/issue_count.svg)](https://codeclimate.com/github/railsconfig/config) -[![Test Coverage](https://codeclimate.com/github/railsconfig/config/badges/coverage.svg)](https://codeclimate.com/github/railsconfig/config/coverage) +[![Maintainability](https://api.codeclimate.com/v1/badges/85c206c13dce7de090af/maintainability)](https://codeclimate.com/github/railsconfig/config/maintainability) +[![Test Coverage](https://api.codeclimate.com/v1/badges/85c206c13dce7de090af/test_coverage)](https://codeclimate.com/github/railsconfig/config/test_coverage) ## Summary Config helps you easily manage environment specific settings in an easy and usable manner. @@ -270,9 +269,30 @@ ### Merge customization * `overwrite_arrays` - overwrite arrays found in previously loaded settings file. Default: `true` * `knockout_prefix` - ability to remove elements of the array set in earlier loaded settings file. Makes sense only when `overwrite_arrays = false`, otherwise array settings would be overwritten by default. Default: `nil` +* `merge_nil_values` - `nil` values will overwrite an existing value when merging configs. Default: `true`. + +```ruby +# merge_nil_values is true by default +c = Config.load_files("./spec/fixtures/development.yml") # => #<Config::Options size=2, ...> +c.size # => 2 +c.merge!(size: nil) => #<Config::Options size=nil, ...> +c.size # => nil +``` + +```ruby +# To reject nil values when merging settings: +Config.setup do |config| + config.merge_nil_values = false +end + +c = Config.load_files("./spec/fixtures/development.yml") # => #<Config::Options size=2, ...> +c.size # => 2 +c.merge!(size: nil) => #<Config::Options size=nil, ...> +c.size # => 2 +``` Check [Deep Merge](https://github.com/danielsdeleo/deep_merge) for more details. ### Validation