-
Notifications
You must be signed in to change notification settings - Fork 239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preserve mutation changes when updating parent_id #272
base: master
Are you sure you want to change the base?
Conversation
cbb34db
to
d20e0c3
Compare
e9ed47e
to
82a2d7c
Compare
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 |
82a2d7c
to
f4e484a
Compare
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. |
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 |
#271