Closed kbrock closed 1 year ago
@kshnurov do you feel that a root node should have all other root nodes as siblings?
Would you prefer that this was behind a feature switch? Seems to me that the current behavior is a bug.
@kshnurov do you feel that a root node should have all other root nodes as siblings?
Yes, it should, I might want to get other root nodes without having to do where(ancestry: self.class.root_ancestry)
, where root_ancestry
is an internal gem method not even described in README.
root? ? nil : siblings
without having all users of this gem to rewrite their code because of the breaking change no one really asked for.To find roots you just use Model.roots
. No internal methods required.
Looks like closure_trees
has root.siblings
point to all roots as well.
I will tell #590 how to solve his problem.
closing
This is a breaking change.
Each tree is a unique tree, so the root node of a tree has no siblings.
Fixes #590