[Betternestedset-talk] Question about getting roots for a given scope

Ben ben at fearofpudding.com
Sun Jun 8 03:38:51 EDT 2008


Hi All,

I have just found this nested set plugin today and so far it is  
fitting my needs very well.
I have one question.  My application has a need for a nested set "per  
user" on the system.  I would like to split these trees using a scope.

so i have in my Task model - acts_as_nested_set :scope=>:user

This all seems to work correctly.  My question is, how can i get the  
roots for this user?  To get the roots for the whole table I am using  
Task.roots()

Is there a way i can get the roots for a given user?

Thanks,
~Ben


More information about the Betternestedset-talk mailing list