Forum: Ruby on Rails :through => 'this', :that => acts_as_tree?!

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
224b787861d66cc06fa539df14672763?d=identicon&s=25 Guest (Guest)
on 2006-12-23 13:15
Hi guys. was wondering, how would i access the various parents/nodes in
an acts as tree, if that model is from a join model using :through?

wa huh?


Say my join class model is called "Crap"

   and there are two columns with foreign keys:

   spam_id and more_spam_id.

Say the Spam class is an acts_as_tree..

I would hope we would be able to access it like we would a habtm:

foo = Crap.find_all_by_spam_id 23
bar = foo.parent.find :all

but it seems these acts_as_tree methods are not avail when using
:through..(or do I need a break and realize something?)

Any insights to lead a poor blind man out of darkness would be nice.

(please excuse the dramatic last statement)
This topic is locked and can not be replied to.