I don''t understand something. Consider the following example: 1) parent = Node.create 2) child = Node.create child.move_to_child_of(parent) So the tree looks now like: parent (level=0) => this is the only root node | child (level=1) What instance method do I have to call on the child node to go to the following structure: parent (level=0) child (level=0) => now there are two root nodes So both nodes have become root nodes now. It may look like a strange situation that a child node would become a root node while it''s old ancestors don''t move inside the tree. I think it''s a bit like The Godfather where one of the caporegimes could start their own family if they served well. It didn''t happen in the movie though... ;-) Kind regards, Mark
Krishna Dole
2007-Mar-23 20:48 UTC
[Betternestedset-talk] child node promoting to root node
move_to_root On 3/23/07, Mark Noten <mark.noten at itfc.be> wrote:> I don''t understand something. Consider the following example: > > 1) parent = Node.create > 2) child = Node.create > child.move_to_child_of(parent) > > So the tree looks now like: > > parent (level=0) => this is the only root node > | > child (level=1) > > What instance method do I have to call on the child node to go to the > following structure: > > parent (level=0) child (level=0) => now there are two root nodes > > So both nodes have become root nodes now. It may look like a strange > situation that a child node would become a root node while it''s old > ancestors don''t move inside the tree. I think it''s a bit like The > Godfather where one of the caporegimes could start their own family if > they served well. It didn''t happen in the movie though... ;-) > > Kind regards, > > Mark > _______________________________________________ > Betternestedset-talk mailing list > Betternestedset-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/betternestedset-talk >
Hi Krishna, I''ve reinstalled the betternestedset plugin from the latest development version in the /trunk directory. But I can''t find the method move_to_root (not as an instance or class method) you''re referring to. ./script/plugin install --force svn://rubyforge.org/var/svn/betternestedset/trunk A /home/mark/projects/ruby/mlm/trunk/vendor/plugins/betternestedset A /home/mark/projects/ruby/mlm/trunk/vendor/plugins/betternestedset/test ... A /home/mark/projects/ruby/mlm/trunk/vendor/plugins/betternestedset/README Exported revision 52. Thanks for your reply, Mark Krishna Dole wrote:> move_to_root > > On 3/23/07, Mark Noten <mark.noten at itfc.be> wrote: > >> I don''t understand something. Consider the following example: >> >> 1) parent = Node.create >> 2) child = Node.create >> child.move_to_child_of(parent) >> >> So the tree looks now like: >> >> parent (level=0) => this is the only root node >> | >> child (level=1) >> >> What instance method do I have to call on the child node to go to the >> following structure: >> >> parent (level=0) child (level=0) => now there are two root nodes >> >> So both nodes have become root nodes now. It may look like a strange >> situation that a child node would become a root node while it''s old >> ancestors don''t move inside the tree. I think it''s a bit like The >> Godfather where one of the caporegimes could start their own family if >> they served well. It didn''t happen in the movie though... ;-) >> >> Kind regards, >> >> Mark >> _______________________________________________ >> Betternestedset-talk mailing list >> Betternestedset-talk at rubyforge.org >> http://rubyforge.org/mailman/listinfo/betternestedset-talk >> >> > _______________________________________________ > Betternestedset-talk mailing list > Betternestedset-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/betternestedset-talk > > >-- Met vriendelijke groet, Mark Noten Software engineer ITFC gcv E-mail: mark.noten at itfc.be GSM: +32 (484) 698 333
Krishna Dole
2007-Mar-26 18:19 UTC
[Betternestedset-talk] child node promoting to root node
Hi Mark, Sorry, I just discovered that method is only in the ez-set branch. Try move_to_left_of or move_to_right_of. Note that you cannot presently move nodes to different trees: you can promote a node to be a virtual root in the present tree, but not the root of a new tree. k On 3/26/07, Mark Noten <mark.noten at itfc.be> wrote:> Hi Krishna, > > I''ve reinstalled the betternestedset plugin from the latest development > version in the /trunk directory. But I can''t find the method > move_to_root (not as an instance or class method) you''re referring to. > > ./script/plugin install --force > svn://rubyforge.org/var/svn/betternestedset/trunk > A /home/mark/projects/ruby/mlm/trunk/vendor/plugins/betternestedset > A /home/mark/projects/ruby/mlm/trunk/vendor/plugins/betternestedset/test > ... > A > /home/mark/projects/ruby/mlm/trunk/vendor/plugins/betternestedset/README > Exported revision 52. > > Thanks for your reply, > > Mark > > Krishna Dole wrote: > > move_to_root > > > > On 3/23/07, Mark Noten <mark.noten at itfc.be> wrote: > > > >> I don''t understand something. Consider the following example: > >> > >> 1) parent = Node.create > >> 2) child = Node.create > >> child.move_to_child_of(parent) > >> > >> So the tree looks now like: > >> > >> parent (level=0) => this is the only root node > >> | > >> child (level=1) > >> > >> What instance method do I have to call on the child node to go to the > >> following structure: > >> > >> parent (level=0) child (level=0) => now there are two root nodes > >> > >> So both nodes have become root nodes now. It may look like a strange > >> situation that a child node would become a root node while it''s old > >> ancestors don''t move inside the tree. I think it''s a bit like The > >> Godfather where one of the caporegimes could start their own family if > >> they served well. It didn''t happen in the movie though... ;-) > >> > >> Kind regards, > >> > >> Mark > >> _______________________________________________ > >> Betternestedset-talk mailing list > >> Betternestedset-talk at rubyforge.org > >> http://rubyforge.org/mailman/listinfo/betternestedset-talk > >> > >> > > _______________________________________________ > > Betternestedset-talk mailing list > > Betternestedset-talk at rubyforge.org > > http://rubyforge.org/mailman/listinfo/betternestedset-talk > > > > > > > > > -- > Met vriendelijke groet, > > Mark Noten > Software engineer > ITFC gcv > E-mail: mark.noten at itfc.be > GSM: +32 (484) 698 333 > > _______________________________________________ > Betternestedset-talk mailing list > Betternestedset-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/betternestedset-talk >