jeudi 4 juin 2015

get count of has_many association in rails query

I have a two model. Post and `Comment'.

Post has_may comments.

Query: I want to get the max count of comments in which post.

This should be done by rail query.

Aucun commentaire:

Enregistrer un commentaire