Open GeekOnCoffee opened 9 years ago
I doubt this will happen too often, but I think the cleanest strategy is to not allow deletion of "parent" nodes (nodes with child nodes). If we do this, we may want to add the ability to choose a new parent node for any child node so the tree can be re-arranged if desired without having to delete things in order and re-create them elsewhere.
The ancestry gem provides several options. I think restricting is best. This way the user has to pick which node should become the new parent of any children nodes before deleting an existing node. If we don't want to implement that, then adopt might be the next best thing. @saturnflyer, @GeekOnCoffee, @elight any opinions?
adopt
seems simple and non-destructive, given that we don't see it happening often, simply moving them to the parent would prevent any unexpected deletion and not require creating an interface to pick the new one.
Extracted from #50
cc: @jcavena