saturnflyer / purple_door

4 stars 3 forks source link

what is the delete strategy for children of a Topic node? #54

Open GeekOnCoffee opened 9 years ago

GeekOnCoffee commented 9 years ago

Extracted from #50

cc: @jcavena

jcavena commented 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.

jcavena commented 9 years ago

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?

GeekOnCoffee commented 9 years ago

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.