Added a new orphan strategy parentify #73

merged 9 commits into from Jun 27, 2012


None yet
6 participants

Consider the following scenerio:

      /  \
   n3     n4

now if the orphan strategy is :parentify and one deletes node n2
the resultant structure would be like this:

      / \
    n3   n4

instead of being

in case the orphan strategy is :destroy OR being the following in case it is :rootify
n1   n3   n4

if one further deletes node n1 then the structure would be:

 n3   n4

unknown added some commits Sep 8, 2011

First Commit
Added Functionality of Parentify.

If a node is deleted, all descendants are added to the parent
of the deleted node.
method and test case modified to be able to rootify the subtree,
 incase the deleted node is a root.

Updated the README.rdoc

femur commented Apr 22, 2012

Looks very usefull for me. I vote for parentify. :)

jkellie commented Apr 26, 2012

agreed parentify would be very helpful. good job!

rymohr commented May 31, 2012

+1 but parentify is a little awkward -- how about inherit or adopt?

@stefankroes -- this pull request has sat here a long time without any comment from you. Any plans to accept it or recreate the behavior?

I do agree, adopt sounds more appropriate, But I am waiting for @stefankroes to respond before making any changes. Thanks for your support.


stefankroes commented Jun 1, 2012

Hey all! Apologies for the silence on my part. I don't have a lot of time to work on this but I'm still willing to work towards a next version. Also, I've been looking for someone to take over maintenance of this gem. I've given several colleagues and other commit access but not a lot has happened. If anyone is willing to gain commit access and merge this pull requests amongst others, I would be willing to grant it.

This feature sounds perfectly reasonable and I think it should be included. Also, I thing adopt is the most appropriate idiom.

ok, I will change the name to adopt. :)

Hi @stefankroes,
I have made all the necessary changes. Please have a look and let me know if any further changes are required.

@StefanH StefanH merged commit 94dba1c into stefankroes:master Jun 27, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment