Hey all.  I'm stuck on something that seems like it should
be simple.  Not sure what I'm missing.

Say I have models:

 Parent has_many        Children
 Child          belongs_to      Parent
 Child          belongs_to      School
 School has_many        Children

The "schools" table has id and name fields.

If I have a parent object p, how do I find the
children of that parent that belong to some specific
school "x"?

I tried stuff like
  p.children.find( :conditions => ["school.name = ?", "x"] )

But that didn't work.

Is there are rails-y way to do this?

Thanks.

        -glenn
_______________________________________________
Sdruby mailing list
[email protected]
http://lists.sdruby.com/mailman/listinfo/sdruby

Reply via email to