I have models such as:
class Team < ActiveRecord::Base
class Game< ActiveRecord::Base
So there are many (well, 0 to 6) games for each team. Team game has a
"score". I would like to get a list of the teams, sorted by the highest
scoring game - sort of a ranking based on highest score. I've tried
several cominations of find and sort, but can't figure it out. I did add
a helper to the Team model:
but still am not sure how to get what I want. I basically want to
display a list of the teams, ranked by their highest score.
One stickler is, any given team may not have any games at a given time,
so team.matches may be null...