Forum: Ruby on Rails has_many :conditions

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
043efdc2a79afbfec84696f50fd42163?d=identicon&s=25 onurturgay (Guest)
on 2005-11-12 12:49
(Received via mailing list)
Hello,

Here is my structure

Node has_many :comments
Comment belongs_to :node

If I specify a :conditions for has_many relationship, I can gather
correct
comments using

n = Node.find(xx)
n.comments

(two queries)

but if I use find(:all, :include=>:comments) then the :conditions is
ignored. All comments belonging to this node is returned. Do I have to
explicitly state :conditions each time I use find? Or am I doing
something
wrong.

Thanks in advance
This topic is locked and can not be replied to.