mardi 7 avril 2015

How group by and get the count in has_many :through rails

Three models



  • Tags

  • Posts

  • PostTags


Tags has many Posts through PostTags


so what i need is to get all the name of tags which has maximum number of posts with the count


Aucun commentaire:

Enregistrer un commentaire