Hi all,

I have a simple Parent "has_many" Child model relationships, and I
have the following query.

Parent.find_by.sql(["select p.* from parent p inner join p.id on
c.parent_id where <some calculation> and c.enabled = :cond", {:cond =>
true}])

This got all the parent object out and it was good.  However, when I
do Parent.children collection, it gives me back all the chile
regardless if the child is enabled or disabled (the condition check
for child in the query).

Is there way to do this?

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to