I have a Collection class which has many coins. I am trying to select collections which have more than two coins. Currently, I have no problem doing that through st
Collection
To answer my own question:
Collection.joins(:coins).group("coins.collection_id").having("count(coins.id) > 2")
Hat tip to KJF who asked this similar question and to krakover for answering it.