I have a Mail model with the following schema:
Mail
t.string \"mail\" t.integer \"country\" t.boolean \"validated\" t.datetime \"created_at\" t.d
I too had to group data with city name and showing count of how many rows are there for each city with specific condition. So this is how I did:
CityData.where(:status => 1).group(:city_name).count
Output of this was:
{:Mumbai => 10, :Dublin => 7, :SF => 9}