def deep_merge(hash_one, hash_two)
      merged = hash_one.dup
      hash_two.each do |key, value|
        merged[key] = case
        when hash_one[key].is_a?(Hash) && value.is_a?(Hash)
          deep_merge(hash_one[key], value)
        when hash_one[key].is_a?(Array) && value.is_a?(Array)
          (hash_one[key] + value).uniq
        else
          value
        end
      end
      merged
    end
def deep_merge(hash_one, hash_two)
      merged = hash_one.dup
      hash_two.each do |key, value|
        merged[key] = case
        when hash_one[key].is_a?(Hash) && value.is_a?(Hash)
          deep_merge(hash_one[key], value)
        when hash_one[key].is_a?(Array) && value.is_a?(Array)
          (hash_one[key] + value).uniq
        else
          value
        end
      end
      merged
    end
Deep merge two hashes. Nested hashes are deep merged, arrays are
 concatenated and duplicate array items are removed.

 @param hash_one [Hash]
 @param hash_two [Hash]
 @return [Hash] deep merged hash.