title: Group by ruby on rails
body: <p>I need to group the users based on created_at column by year and month, </p>
  
  <p><code>User.all.group_by{ |q| [q.created_at.year, q.created_at.month]}</code>,
   where I am getting hash with key [year, month], Is there any way to group the records which results like </p>
  
  <pre><code>{ 
    year1 =&gt;{ month1 =&gt;[array of records], month2=&gt;[array]}, 
    year2 =&gt;{ month1 =&gt;[array of records], month2=&gt;[array]}
  }
  </code></pre>