On 29.11.2005, at 2.31, Hunter H. wrote:
Just use the normal find method with :joins => “inner join
order_lines”. Inner join only gives you the rows that have a(t least
one) matching row in the joined table.
All in all, I’d recommend doing the screening in the db end.
find :all, :joins => “inner join order_lines on orders.id =
Note that the orders will be returned read_only by default. However,
that is less of a problem that you might think, since you rarely edit
objects in the same action where you fetch them. You can also
override this behaviour by passing the find method :readonly => false.