RoR - print count after group_by <p>In my Ruby on Rails application, I want to print a count result after I grouped my records in database and I get something like that :</p> <pre><code>{1=&gt;6} </code></pre> <p>In my database there is 6 records, all with the same <code>user_id</code>.</p> <p>Here is my code :</p> <pre><code>Whatever.group(:user_id).count(:user_id) </code></pre> <p>I just want to print <strong>1</strong> how to do this. I tried with <code>distinct</code> and <code>uniq</code> without any success...</p>