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
AVOID eager loading detected
M1M2 => [:m1]
Remove from your query: .includes([:m1])
Expected
No error.
I do not expect this error because the included m1 association is used every iteration the loop. As well, the cached m1.m1_m2s.find_by!(m2:) is not used in the loop.
Introduction
This error is new to the project. I bisected the introduction of the error to:
Given the following schema:
And the following model definitions:
The following script results in a Bullet error:
Actual
Expected
No error.
I do not expect this error because the included m1 association is used every iteration the loop. As well, the cached
m1.m1_m2s.find_by!(m2:)
is not used in the loop.Introduction
This error is new to the project. I bisected the introduction of the error to:
Test project
I created a minimal test project that includes the models and script above at:
https://github.com/jdufresne/test-bullet
The text was updated successfully, but these errors were encountered: