Acts as nested set


#1

Hi Railers,

Is the nested set model restricted to only one root?

I’m working on a screencast building a threaded forum and nested set
comes
close but is lacking a few items for this project.

First, all the documentation I can find restricts a nested_set to one
root
node, and a threaded forum would have many roots. Also, without a ton of
fancy sql or an ungodly amount of db calls, it doesn’t track the depth.

Is my understanding of nested sets correct?

I created an acts_as_threaded to get around these “limitations” which
performs well for this scenario, just curious if nested_set could also
have
been used if I had a better understanding of it.

Thanks

Bob S.
http://www.railtie.net/


#2

Hi Bob,

I’m currently working with acts_as_nested_set too; I’ve applied all
known
patches on dev.rubyonrails.com, which makes it far more usable. Although
it’s still limited to one root, if you setup a level column, it is able
to track
depth easily.

I’m interested in your approach. Could you post your code somewhere?

Regards,

Fabien