Why doesn't acts_as_tree support :scope?


#1

I want to implement a unique category tree per user in my system, and I
was hoping to use “acts_as_tree” on my category model. It seems as if
acts_as_tree makes the assumption that the entire table the model is off
of is one large tree. I actually want each user to have their own
category trees all stored in the category table so I need it to scope
off of the user_id.

acts_as_list supports the scope idea. Am I missing something simple?


#2

I tried acts_as_tree in combination with scope a while ago and it
definitly worked. There were no tricks or obstacles, although if I
remember correctly I misunderstood the API doc or some example I found.
Just a

acts_as_tree :scope => “tree_id”

was sufficiant. Of course I had to pass tree_id with every save. Calling
parent afterwards made the whole thing working for me.


#3

Mike B wrote:

I want to implement a unique category tree per user in my system, and I
was hoping to use “acts_as_tree” on my category model. It seems as if
acts_as_tree makes the assumption that the entire table the model is off
of is one large tree. I actually want each user to have their own
category trees all stored in the category table so I need it to scope
off of the user_id.

acts_as_list supports the scope idea. Am I missing something simple?

cccccccccc