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
Hi @yfxie, this one runs deep! :) It's been around for a while. I don't have time to dig too deep at the moment but if you're able to figure out why we're doing this in the first place that'd help heaps! If we can remove this, or replace it with something that achieves the same outcome (without the bug) then that would be great.
Here's what I know:
reload has been there as long as I've been maintaining this gem. For a while it was replaced by lock! but this was causing problems so it was reverted. d0b2b81
There are no issue references there that I could find, but it seems that we need to reload the position of items just before delete if we're deleting lots of them as their position will have changed and is used in shuffling things around.
If we remove counter_cache and the test will pass. I found the bug due to
before_destroy :reload
(here)So the following code is a failure case too
For any reason, I think it shouldn't call reload at callbacks.
The text was updated successfully, but these errors were encountered: