bullet icon indicating copy to clipboard operation
bullet copied to clipboard

False positive for unused_preload_association

Open darren987469 opened this issue 6 years ago • 1 comments

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.

darren987469 avatar Jan 10 '19 04:01 darren987469

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!

billgloff avatar Jan 16 '19 21:01 billgloff