Skip to content

Added a new orphan strategy parentify #73

Merged
merged 9 commits into from Jun 27, 2012

6 participants

@ridsagrawal

Consider the following scenerio:


       n1
       |
       n2
      /  \
   n3     n4
          |
         n5

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


       n1
       |
      / \
    n3   n4
          |
         n5

instead of being


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

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

 n3   n4
      |
      n5
unknown added some commits Sep 8, 2011
unknown First Commit
Added Functionality of Parentify.

If a node is deleted, all descendants are added to the parent
of the deleted node.
aec25d1
unknown added test cases de34c81
unknown test improved to consistency 33fe81b
unknown removed unwanted test 6c2876e
unknown method and test case modified to be able to rootify the subtree,
 incase the deleted node is a root.

Updated the README.rdoc
3838cfd
unknown README - Replaced TAB with Space 1f52799
unknown Revert "README - Replaced TAB with Space"
This reverts commit 1f52799.
8550334
unknown minor changes in the README a57de86
@femur
femur commented Apr 22, 2012

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

@jkellie
jkellie commented Apr 26, 2012

agreed parentify would be very helpful. good job!

@rymohr
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?

@ridsagrawal

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

@stefankroes
Owner

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.

@ridsagrawal

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

@ridsagrawal

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
Something went wrong with that request. Please try again.