Would you not use..<br><br>user.albums.root() <br><br>?<br><br><div class="gmail_quote">On Fri, Apr 4, 2008 at 3:31 PM, Peter Schrammel <<a href="mailto:peter.schrammel@gmx.de">peter.schrammel@gmx.de</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thanks Stephen<br>
<br>
but if you look at the code further down:<br>
def root(scope = {})<br>
find_in_nested_set(:first, { :conditions =><br>
"(#{prefixed_parent_col_name} IS NULL OR #{prefixed_parent_col_name} =<br>
0)" }, scope)<br>
end<br>
<br>
So the so called inner_scope is set to the scope I pass. But then<br>
somewhere in find_in_nested_set it throws the error...sigh.<br>
<br>
Nobody ever needed the root of a scope (I have only one per scope)?<br>
<br>
<br>
Stephen Schor schrieb:<br>
<div class="Ih2E3d">> Hi Peter,<br>
><br>
> My table contains multiple roots using scope. I've never really called<br>
> .root on the class.<br>
> I've sometimes wanted to find the root of an instance by calling<br>
> my_instance.root to return<br>
> the top-most ancestor or my_instance.<br>
><br>
> Also - looking at the comments of .root in the SingletonMethods module -<br>
> there's this info...<br>
><br>
> # Returns the single root for the class (or just the first root, if<br>
> there are several).<br>
> # Deprecation note: the original acts_as_nested_set allowed roots to<br>
> have parent_id = 0,<br>
> # so we currently do the same. This silliness will not be tolerated in<br>
> future versions, however.<br>
><br>
> I hope this is helpful to you.<br>
><br>
<br>
</div><div><div></div><div class="Wj3C7c">_______________________________________________<br>
Betternestedset-talk mailing list<br>
<a href="mailto:Betternestedset-talk@rubyforge.org">Betternestedset-talk@rubyforge.org</a><br>
<a href="http://rubyforge.org/mailman/listinfo/betternestedset-talk" target="_blank">http://rubyforge.org/mailman/listinfo/betternestedset-talk</a><br>
</div></div></blockquote></div><br>