Improve documentation to clarify reparenting
I spent a little time working out a before_save callback to handle assigning nodes to a new parent node when the object's parent_id had been changed. Of course, I got an endless loop, resulting in neat SystemStackError, "stack level too deep".
When I removed the callback, and just allowed the record to save normally, I discovered that closure_tree was already doing all of the work for me, to my delight (though not really surprise, given how well thought-out this gem is).
I think it would be helpful to mention in the README under the "Moving nodes around the tree" section that if you're working with parent_id directly (like in a <form>``<select>, as I am), it just works.
That sounds very helpful. Do you want to suggest the edits to the readme in a pull request? (You should be able to just click the edit button).
Thanks for taking the time to open this issue.
another README.md fix
j = Tag.find 102
j.self_and_ancestor_ids
=> [102, 87, 77]
j.update parent_id: 96
j.self_and_ancestor_ids
=> [102, 96, 95, 78]
should the last array look like this [102, 87, 77, 96] ?