Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a bug with whitelisting polymorphic associations? #564

Open
aximuseng opened this issue Apr 2, 2021 · 1 comment
Open

Is there a bug with whitelisting polymorphic associations? #564

aximuseng opened this issue Apr 2, 2021 · 1 comment

Comments

@aximuseng
Copy link

I am getting these:

USE eager loading detected
  ActivityTask => [:taskable]
  Add to your query: .includes([:taskable])

The association is polymorphic so I can't add an include so I added a whitelist:

Bullet.add_whitelist type: :unused_eager_loading, class_name: "ActivityTask", association: :taskable

The bullet warnings persist even after adding this.

@drnic
Copy link

drnic commented Nov 21, 2022

Broadly, how do we get Bullet to ignore polymorphic associations? It complains that they aren't eagerly loaded, but later complains that they are polymorphic.

Update: I found Bullet.add_safelist to exclude each specific scenario

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants