Forum: Ruby on Rails acts_as_paranoid and :include

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.
F0d09ef2a279cae4ac312164aa1af6d3?d=identicon&s=25 Ian Connor (Guest)
on 2006-03-14 11:34
(Received via mailing list)
Will the find from acts_as_paranoid filter down to an :include?

For instance

class parent
acts_as_paranoid
has_many: children
end

and

class child
acts_as_paranoid
belongs_to :parent
end

Then if you

Parent.find(:all, :include => children)

you will get all the children if they are deleted or not. I guess the
find
that filters out the deleted_at is null does not filter down to the
includes
like this.
821395fe70906c8290df7f18ac4ac6cf?d=identicon&s=25 Rick Olson (Guest)
on 2006-03-14 16:36
(Received via mailing list)
On 3/14/06, Ian Connor <ian.connor@gmail.com> wrote:
>
> that filters out the deleted_at is null does not filter down to the includes
> like this.
>
> --
> Regards,
> Ian Connor

Nope.

has_many :children, :conditions => "deleted_at IS NULL"


--
Rick Olson
http://techno-weenie.net
F0d09ef2a279cae4ac312164aa1af6d3?d=identicon&s=25 Ian Connor (Guest)
on 2006-03-16 10:45
(Received via mailing list)
thanks - that would certain fix it :)
This topic is locked and can not be replied to.