closure_tree
closure_tree copied to clipboard
Preserve mutation changes when updating parent_id
https://github.com/mceachen/closure_tree/issues/271
Thanks for your PR, but I won't be able to merge until the tests pass. I don't have time to help with that right now.
@mceachen Having a hard time to run all tests. I will try to handle that.
Any progress on fixing the tests?
@mceachen no. It would be awesome to have tests prepared in Docker
@mceachen no. It would be awesome to have tests prepared in Docker
Hi there! Now the master branch is stable can you please rebase to see if it works? Thank you!
I merged master with this PR and kicked off another build here: https://travis-ci.org/ClosureTree/closure_tree/builds/391065251. Checks failed.
Checks failed.
If (you) don't change the if logic and keep some redundant code test pass :)
changed = public_send(changes_method)[_ct.parent_column_name]
if changed || @was_new_record
_ct_persist_activerecord_state do
rebuild!
end
end
if changed && !@was_new_record
# Resetting the ancestral collections addresses
# https://github.com/mceachen/closure_tree/issues/68
_ct_persist_activerecord_state do
ancestor_hierarchies.reload
self_and_ancestors.reload
end
end
This :
if changed || @was_new_record
...
end
if changed && !@was_new_record
...
end
has nothing to do with this :
if changed
if @was_new_record
...
else
...
end
end
The change should not break tests as we only save and restore some instance variables but it would be great to have tests to cover this case.
@schovi can you please rebase on master
branch? thank you!