-
Notifications
You must be signed in to change notification settings - Fork 824
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
FIX eagerLoad crash with nonterminal hasOne relation #11483
base: 5.3
Are you sure you want to change the base?
Conversation
Looks like the failing tests are because the number of queries is no longer as previously expected. I'd appreciate input on how what I've done here has caused extra queries. |
My guess, having looked briefly at the code changes but not at the tests, is that the tests were actually not correct, and chains with |
2378751
to
1239859
Compare
After investigation, the tests indeed did their job and caught a bug in my code, now fixed. |
@GuySartorelli I did resolve the failing tests, in case you missed it. The tests were correct and I was missing out on some eager fetching because of a bug. |
Thanks yup. I saw that just haven't had a chance to come back to this yet. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good and seems to work as expected, thanks for taking the time to do this.
Couple of things:
- Can you please add some unit tests? One to check that this works as expected for
HasOne.HasMany
(i.e. the intended use case) and one to check that the exception is thrown forPolymorphicHasOne.HasMany
? - Can you please retarget this to the
5.3
branch? That way the patch can be released immediately rather than waiting for the April minor release.
You may need to reset your commits after retargeting the PR.
1239859
to
18392e7
Compare
18392e7
to
25ed64f
Compare
@GuySartorelli all done! |
Addresses #11470