fix increase_parent_counter_cache callback #618
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Counter caches get corrupted.
It is possible that strategy: sql is the culprit here.
There is also probably a problem around cache depth too.
The
increase_parent_counter_cache
callback is not consistent with thedecrease_parent_counter_cache
or the udpatesome ideas on making them consistent and fixing the problem
@_trigger_delete_callback
(are these unnecessary internals?)Not sure if update follows the same rules as destroy introduced in 63b42f5 But would like both trees to follow the same logic
There are reports of incorrect cache counts. So when insert and destroy have different guard clauses, it is suspect.
I admit that I am not totally familiar to the core use case so I will need to more into why this was introduced in #307 - trying to resolve #584 (and may be able to provide advice for #586 )
TODO:
descendants_count
counter cache? #586 )