diff --git a/CHANGELOG b/CHANGELOG index 19b8eae..8dec18b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,4 @@ + * removed deep_merge and deeper_merge, if you used them replace with `!` variant with `preserve_unmergeables: true` * Dropped support for ruby versions before 2.7 2022-01-07 Jason Frey @@ -64,7 +65,7 @@ 2010-01-11 Dan DeLeo - * fix boolean merging according to mdkent's patch explicitly test + * fix boolean merging according to mdkent's patch explicitly test for nils w/ #nil? instead of negating. Thanks mdkent! 2009-12-25 Dan DeLeo diff --git a/README.md b/README.md index 4ea9cc6..bba0368 100644 --- a/README.md +++ b/README.md @@ -174,7 +174,6 @@ In a Gemfile: The deep_merge methods will then be defined as - Hash#deeper_merge Hash#deeper_merge! Hash#ko_deeper_merge! diff --git a/lib/deep_merge/deep_merge_hash.rb b/lib/deep_merge/deep_merge_hash.rb index e07b4cd..c4ddea3 100644 --- a/lib/deep_merge/deep_merge_hash.rb +++ b/lib/deep_merge/deep_merge_hash.rb @@ -13,13 +13,6 @@ def deep_merge!(source, options = {}) default_opts = {:preserve_unmergeables => false} DeepMerge::deep_merge!(source, self, default_opts.merge(options)) end - - # deep_merge will merge and skip any unmergeables in destination hash - def deep_merge(source, options = {}) - default_opts = {:preserve_unmergeables => true} - DeepMerge::deep_merge!(source, self, default_opts.merge(options)) - end - end # DeepMergeHashExt end diff --git a/lib/deep_merge/rails_compat.rb b/lib/deep_merge/rails_compat.rb index 7b89a5c..a619c8f 100644 --- a/lib/deep_merge/rails_compat.rb +++ b/lib/deep_merge/rails_compat.rb @@ -13,12 +13,6 @@ def deeper_merge!(source, options = {}) default_opts = {:preserve_unmergeables => false} DeepMerge::deep_merge!(source, self, default_opts.merge(options)) end - - # deeper_merge will merge and skip any unmergeables in destination hash - def deeper_merge(source, options = {}) - default_opts = {:preserve_unmergeables => true} - DeepMerge::deep_merge!(source, self, default_opts.merge(options)) - end end end diff --git a/test/test_deep_merge.rb b/test/test_deep_merge.rb index 7551150..3cf7d0d 100644 --- a/test/test_deep_merge.rb +++ b/test/test_deep_merge.rb @@ -35,7 +35,7 @@ def test_hash_deep_merge hash_src = {'id' => 'xxx'} hash_dest = {'id' => [1,2,3]} - assert hash_dest.deep_merge(hash_src) + assert hash_dest.deep_merge!(hash_src, preserve_unmergeables: true) assert_equal({'id' => [1,2,3]}, hash_dest) end