I have a Teams that has_many Players.
I need to get the list of Teams that have no active players (whether
they have 0 players or they have a lot of players all of whom are non-
active).
Can't figure out the conditions for doing this other than subtracting
the ones with active players from the
Try:
named_scope :without_active_players, :conditions = NOT EXISTS(SELECT *
FROM players WHERE team_id=teams.id AND status='active'), :order = name
Does this work?
Lasse
2010/2/14 cpr crosebr...@gmail.com
I have a Teams that has_many Players.
I need to get the list of Teams that have no
2 matches
Mail list logo