def chartkick_deep_merge(hash_a, hash_b)
      hash_a = hash_a.dup
      hash_b.each_pair do |k, v|
        tv = hash_a[k]
        hash_a[k] = tv.is_a?(Hash) && v.is_a?(Hash) ? chartkick_deep_merge(tv, v) : v
      end
      hash_a
    end
def chartkick_deep_merge(hash_a, hash_b)
      hash_a = hash_a.dup
      hash_b.each_pair do |k, v|
        tv = hash_a[k]
        hash_a[k] = tv.is_a?(Hash) && v.is_a?(Hash) ? chartkick_deep_merge(tv, v) : v
      end
      hash_a
    end
def chartkick_deep_merge ( hash_a , hash_b ) hash_a = hash_a . dup hash_b . each_pair do | k , v | tv = hash_a [ k ] hash_a [ k ] = tv . is_a? ( Hash ) && v . is_a? ( Hash ) ? chartkick_deep_merge ( tv , v ) : v end hash_a end
https://github.com/rails/rails/blob/master/activesupport/lib/active_support/core_ext/hash/deep_merge.rb
https : // github . com / rails / rails / blob / master / activesupport / lib / active_support / core_ext / hash / deep_merge . rb