Just wanted to ask if anyone knows how to find the 5 most frequent values ββin the colomn model for the active record.
eg,
Country.find(:name)
How can I find the 5 most common countries
Use the following
Country.group(:name).order('count_id DESC').limit(5).count(:id)