You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been trying out closure_tree in a Rails 3.2.12 app, replacing a home-grown parent/child relationship.
The model in question has an after_commit hook that relies on the value of previous_changes. When I switch over to closure_tree and use the :order option, previous_changes is empty when my after_commit hook is called.
I haven't had a chance to put together a small, reproducible test case, but the root cause is the reload call in NumericDeterministicOrdering::_ct_reorder_siblings. reload causes both changes and previous_changes to be flushed and this happens before my after_commit callback has a chance to run.
I don't have a good sense of what it would take to fix this, sorry.
The text was updated successfully, but these errors were encountered:
You could look in hierarchy_maintenance.rb for an example of change hooks that you could add. I've never used previous_changes, but you could save that in a new before_save that you add.
I've been trying out closure_tree in a Rails 3.2.12 app, replacing a home-grown parent/child relationship.
The model in question has an
after_commit
hook that relies on the value ofprevious_changes
. When I switch over to closure_tree and use the:order
option,previous_changes
is empty when myafter_commit
hook is called.I haven't had a chance to put together a small, reproducible test case, but the root cause is the
reload
call inNumericDeterministicOrdering::_ct_reorder_siblings
.reload
causes bothchanges
andprevious_changes
to be flushed and this happens before myafter_commit
callback has a chance to run.I don't have a good sense of what it would take to fix this, sorry.
The text was updated successfully, but these errors were encountered: