Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
Expand Down Expand Up @@ -64,7 +65,7 @@

2010-01-11 Dan DeLeo <[email protected]>

* 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 <[email protected]>
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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!

Expand Down
7 changes: 0 additions & 7 deletions lib/deep_merge/deep_merge_hash.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 0 additions & 6 deletions lib/deep_merge/rails_compat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with the idea of this PR. Although, we should probably deprecate this first in a release, then drop it after.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please make that PR then, not using this library anymore

end
end

Expand Down
2 changes: 1 addition & 1 deletion test/test_deep_merge.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down