module ActiveSupport::DeepMergeable

def deep_merge(other, &block)


# => { a: 100, b: 450, c: { c1: 300 } }
end
this_val + other_val
hash_1.deep_merge(hash_2) do |key, this_val, other_val|

hash_2 = { b: 250, c: { c1: 200 } }
hash_1 = { a: 100, b: 200, c: { c1: 100 } }

A block can be provided to merge non-DeepMergeable values:

# => { a: false, b: { c: [1, 2, 3], x: [3, 4, 5] } }
hash_1.deep_merge(hash_2)

hash_2 = { a: false, b: { x: [3, 4, 5] } }
hash_1 = { a: true, b: { c: [1, 2, 3] } }

end
include ActiveSupport::DeepMergeable
class Hash

Returns a new instance with the values from +other+ merged recursively.
:nodoc:
to provide a merge!(other, &block) method.
Provides +deep_merge+ and +deep_merge!+ methods. Expects the including class
def deep_merge(other, &block)
  dup.deep_merge!(other, &block)
end