Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Clan < ActiveRecord::Base
- belongs_to :account
- has_many :accounts
- def accounts_sorted_by_xp
- leader = self.account
- plebs = self.accounts
- plebs.sort { |l,r| l.ranked_xp <=> r.ranked_xp }
- [leader, plebs].flatten
- end
- end
Add Comment
Please, Sign In to add comment