title: Ruby: Nested hash loses keys and values on merging with another nested hash
body: <p>I have a hash-</p>
  
  <pre><code>h1 = {"a"=&gt;{"x"=&gt;"1","y"=&gt;"2"}, "b"=&gt;"z"}
  </code></pre>
  
  <p>I have another hash <code>h2</code> which basically has updated values for some keys in <code>h1</code></p>
  
  <pre><code>h2 = {"a"=&gt;{"x"=&gt;"3"}, "b"=&gt;"q"}
  </code></pre>
  
  <p>when I do a -</p>
  
  <pre><code>h1.merge(h2)
  </code></pre>
  
  <p>I am expecting it to return-</p>
  
  <p><code>{"a"=&gt;{"x"=&gt;"3","y"=&gt;"2"}, "b"=&gt;"q"}</code></p>
  
  <p>But it actually gives me- 
  <code>{"a"=&gt;{"x"=&gt;"3"}, "b"=&gt;"q"}</code></p>
  
  <p>What do I need to do to get <code>{"a"=&gt;{"x"=&gt;"3","y"=&gt;"2"}, "b"=&gt;"q"}</code> ?</p>
  
  <p>I am <strong>not</strong> using rails. The ruby version is <strong>2.6.0</strong></p>