Using acts_as_tree, is it possible to get information of the depth a tree leaf in relation to the root? Or is available to derive information to save in the way "position" can be derived and saved for acts_as_list. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Jean-Christophe Michel
2006-Dec-25 11:12 UTC
Re: Active Record acts_as_tree and leaf depth
Hi Tony, Le 25 déc. 06, à 08:03, Tony K. a écrit :> Using acts_as_tree, is it possible to get information of the depth a > tree leaf in relation to the root? Or is available to derive > information to save in the way "position" can be derived and saved for > acts_as_list.It cannot be done simply. Check nested_set instead, where this info is simple to retrieve. Jean-Christophe Michel -- symetrie.com Better Nested Set for rails: http://opensource.symetrie.com/trac/better_nested_set --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks for the response. I will look in nested_set. Can a table using acts_as_tree be used in combination with single table inheritance as described in the book Agile Web Development with Rails, pg. 263? On 12/25/06, Jean-Christophe Michel <jc.michel-/aRvmaKoZxNWk0Htik3J/w@public.gmane.org> wrote:> > Hi Tony, > > Le 25 déc. 06, à 08:03, Tony K. a écrit : > > Using acts_as_tree, is it possible to get information of the depth a > > tree leaf in relation to the root? Or is available to derive > > information to save in the way "position" can be derived and saved for > > acts_as_list. > > It cannot be done simply. Check nested_set instead, where this info is > simple to retrieve. > > > Jean-Christophe Michel > -- > symetrie.com > > Better Nested Set for rails: > http://opensource.symetrie.com/trac/better_nested_set > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---