Allows for deep merging

Methods
Public Instance methods
deep_merge(other_hash)

Returns a new hash with self and other_hash merged recursively.

    # File activesupport/lib/active_support/core_ext/hash/deep_merge.rb, line 7
 7:         def deep_merge(other_hash)
 8:           self.merge(other_hash) do |key, oldval, newval|
 9:             oldval = oldval.to_hash if oldval.respond_to?(:to_hash)
10:             newval = newval.to_hash if newval.respond_to?(:to_hash)
11:             oldval.class.to_s == 'Hash' && newval.class.to_s == 'Hash' ? oldval.deep_merge(newval) : newval
12:           end
13:         end
deep_merge!(other_hash)

Returns a new hash with self and other_hash merged recursively. Modifies the receiver in place.

    # File activesupport/lib/active_support/core_ext/hash/deep_merge.rb, line 17
17:         def deep_merge!(other_hash)
18:           replace(deep_merge(other_hash))
19:         end