ActiveRecord query help .count
I have a DB table users that has the following columns: id, clan_id, experience
I want to run a开发者_Go百科 query using rails that returns the top 50 clans based on experience. How would you do this query in rails?
Clan Table to User Table is a one to many relationship. Thus a clan is composed of multiple users that have the same id.
Clan.find(:all, :order => "experience DESC", :limit => 50)
精彩评论