Re: can this be done without using find_by_sql

Phlip
Sat, 14 Feb 2009 11:45:22 -0000

tonypm wrote:

> Repair has_many :notes
>
> SELECT * FROM repairs
> where exists
> (select * from notes where repairs.id=notes.repair_id
>            and  and notes.flagged)

   r = Repair.find(...)
   notes = r.notes.find_by_flagged(true)

I can''t think of a way to learn how deep the ActiveRecord DSL gets,
besides read
read read blogs, tutorials, books, and its documentation! I myself probably know
only 30% of it!

--
   Phlip