On 8/10/07, Glenn Little <[EMAIL PROTECTED]> wrote:
>
> I tried stuff like
>    p.children.find( :conditions => ["school.name = ?", "x"] )


This would have given you an SQL error about not being able to find that
column or table, no? That's because the query being generated by Rails here
isn't joining the schools table (not "schools" not "school" but either way
it won't work yet).

Try this:
  p.children.find(:include => :school, :conditions => ["schools.name = ?",
"foo"])


-- 
Nick Zadrozny • beyondthepath.com
_______________________________________________
Sdruby mailing list
[email protected]
http://lists.sdruby.com/mailman/listinfo/sdruby

Reply via email to