mardi 14 avril 2015

How to get the highest association in a record

I currently have a rails app that has a class Post. Post belongs_to Users.


How do you get the top 3 users that posts a lot? I'm guessing its somewhere



Post.all.users.(do something here to get the user count and know who are the top 3

Aucun commentaire:

Enregistrer un commentaire