I can use the following :
User.where("zip_code = '48104'").group('users.id').count
To get hashes like :
{195=>1, 106=>1, 120=>1, 227=>1, 247=>1, 264=>1, 410=>1}
Is there a way I can count these hashes, and just return 7, instead of the above result ?
I know this doesn’t make sense in the above scenario, and I can just do it by not using the group clause. But I’m working on a more complex query, where I need to implement this. Thanks in advance.
Try: