so i have a parent and child model, i need to get all the entries in my
parent model that don’t yet have a child. i can do a find all and
iterate through all the buggers, but this is a little cpu intensive. How
can i get something like this pseudo code to work??
@parents = Parent.find(:all, :conditions => [ :children => nil ])
for bonus points you can do the same thing with a parent, child , and
@parents = Parent.find(:all, :include => :children, :conditions =>
[:childrens-children => nil ])