So I have two tables:

- teams
- players

I'm trying to find all teams that have no players. I thought this could
work:

Team.find(:all, :joins => :players, :conditions => ["players.size = ?",
0] )

Of course that's not working for me because I'm mixing the SQL with
Rails. Do you know the proper way to find all teams that have no
players?
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to