I've got table with different actions from users, it looks like that
| User_ID | Action |
| ------------- |:-------------:|
| 10 | View |
| 8 | Connect |
| 10 | View |
| 12 | View |
| 10 | View |
And i want to count how many users made "View" action. So i made Query
Actions.where( action: "View" ).group(:User_ID).count
But it showed me
{10=>3, 12=>1}
So I added second ".count" at the end
Actions.where( action: "View" ).group(:User_ID).count.count
And now it's working properly
Is double count here only and proper way?