Closed PikachuEXE closed 3 years ago
Totals | |
---|---|
Change from base Build 298: | 0.04% |
Covered Lines: | 748 |
Relevant Lines: | 780 |
Totals | |
---|---|
Change from base Build 293: | 3.9% |
Covered Lines: | 745 |
Relevant Lines: | 747 |
Thank you for catching that! I'll try to dig into it during the next few days
The problem is that when includes
is called, Rails loads users
association as part of posts
relation initialization. It means that when users
relation is loaded, preloads_associations_lazily?
returns false
and context is not created. I wonder if we could somehow detect preloading and check if parent association can be lazily loaded (we could do it in the Preloader
, but it only has an access to an Array
of Post
models, not relation).
I guess we should add this issue to the README for now 🙂
Let's update the readme for now
Not an urgent issue for me (I just swap remove calls to includes
)
I've added a line and mentioned this issue, so let's keep it open 🙂
Fixed by #48
This is actually for a potential bug I found and I don't know how to fix Bug: If
#includes
is called before#preload_associations_lazily
, any association not mentioned inincludes
will not be loaded in a batch when calledSee test case for