Merge 2 different arrays in ruby
<p>I would like merge 2 arrays with different data inside.</p>

<p>Here's the first array :</p>

<pre><code>[
 [Wed, 30 Mar 2016, 2],
 [Fri, 01 Apr 2016, 1],
 [Sat, 02 Apr 2016, 1],
 [Sun, 03 Apr 2016, 1]
]
</code></pre>

<p>And here is the second array :</p>

<pre><code>[
 Sun, 27 Mar 2016,
 Mon, 28 Mar 2016,
 Tue, 29 Mar 2016,
 Wed, 30 Mar 2016,
 Thu, 31 Mar 2016,
 Fri, 01 Apr 2016,
 Sat, 02 Apr 2016,
 Sun, 03 Apr 2016
]
</code></pre>

<p>Result i would like :</p>

<pre><code>[
 Sun, 27 Mar 2016=&gt;0,
 Mon, 28 Mar 2016=&gt;0,
 Tue, 29 Mar 2016=&gt;0,
 Wed, 30 Mar 2016=&gt;2,
 Thu, 31 Mar 2016=&gt;0,
 Fri, 01 Apr 2016=&gt;1,
 Sat, 02 Apr 2016=&gt;0,
 Sun, 03 Apr 2016=&gt;1
]
</code></pre>

<p>And finally, this is the code for have 2 arrays</p>

<pre><code>    @last_7_days = Statistic.where("date(created_at) &gt; ?", 7.days.ago).group("date(created_at)").count
    @last_days = Date.today.downto(Date.today - 7.days).reverse_each.collect{|m| m}
</code></pre>