How can I write an AR find query to have the results ordered by the number of records in a has_many association?
class User < ActiveRecord::Base has_man
Counter cache will help, but you'll need an extra column in the db.