bullet
bullet copied to clipboard
False positive for unused_preload_association
I upgrade bullet from 5.7.5 to 5.9.0 and the following spec fail.
it 'should not detect unused preload associations' do
comment = Comment.last
post = Post.last
comment.update(post: post)
Bullet::Detector::UnusedEagerLoading.check_unused_preload_associations
expect(Bullet::Detector::Association).not_to be_has_unused_preload_associations
end
After digging, it looks like the bug was introduced at 582b2d4b. In the spec, it misses the call check_unused_preload_associations
and the spec fails. I opened a PR to show that #444.
Also seeing the same behavior and have been on version 5.7.5 ever since last summer. Please look into merging the attached pr if it indeed fixes this issue. Thanks!