I think this is something along the lines of what we want here? Do we maybe want to use find_by_id instead of find? Additionally, some of the behavior of the root_at method seems a bit funky to me, but it may just be me misinterpreting the results.
The first tree in that image is unrooted. The second should be rooted at a. The third at f. The tree was already "rooted" at a, and telling it to actually root at a looks like it just replaced the a with the word root. So now we have no a. And I confirmed by trying to find a in that tree that a no longer exists.
a also inexplicably doesn't exist in the f rooted tree which also isn't actually rooted at f. Any time I tried to root at anything other than a I got something similar to the f rooted tree (i.e. something not actually rooted where I thought I told it to and without an a node)
I think this is something along the lines of what we want here? Do we maybe want to use
find_by_id
instead offind
? Additionally, some of the behavior of theroot_at
method seems a bit funky to me, but it may just be me misinterpreting the results.The first tree in that image is unrooted. The second should be rooted at
a
. The third atf
. The tree was already "rooted" ata
, and telling it to actually root ata
looks like it just replaced thea
with the wordroot
. So now we have noa
. And I confirmed by trying to finda
in that tree thata
no longer exists.a
also inexplicably doesn't exist in thef
rooted tree which also isn't actually rooted atf
. Any time I tried to root at anything other thana
I got something similar to thef
rooted tree (i.e. something not actually rooted where I thought I told it to and without ana
node)