Merge two array of hashes
<p>I have two arrays of hashes and want to do one from it </p>

<pre><code>first = 
[{:frontman=&gt;"aaa", :category=&gt;"bbb", :subcategory=&gt;nil, :detail=&gt;nil},other hashes]


second = 
[{:__content__=&gt;"aaa", :id=&gt;"9096290", :frontman=&gt;"aaa"},other hashes]
</code></pre>

<p>I want to have</p>

<p>one large array of hashes</p>

<pre><code>[{:__content__=&gt;"aaa", :id=&gt;"9096290", :frontman=&gt;"aaa", :category=&gt;"bbb", :subcategory=&gt;nil, :detail=&gt;nil},other hashes]
</code></pre>

<p>i have tried it </p>

<pre><code>(first+second).group_by{|h| h[:frontman]}.map{|k,v| v.reduce(:merge)}
</code></pre>

<p>but it doesn't work for me</p>