-
Notifications
You must be signed in to change notification settings - Fork 11.4k
[12.x] feat: add CanBeOneOfMany
support to HasOneThrough
#54759
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
Conversation
@@ -131,8 +131,6 @@ public function ofMany($column = 'id', $aggregate = 'MAX', $relation = null) | |||
]; | |||
} | |||
|
|||
$this->addConstraints(); |
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.
Why is this removed?
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.
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.
The removal of this constraint causes all rows in the database to be loaded and than filtered while before the query was more narrow and only returned the required results. I have opened an issue for this, I can create a PR reverting this change but I don't know what the impact is on the feature that was added in this PR.
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.
@BertvanHoekelen, the constraints should have already been added by the time this was called (in the Relation constructor)---see the tests, this was adding double constraints.
I'll take a look, there must be a path where the constraints aren't added but we didn't have a test case for it
Thanks! |
@calebdw would you mind PRing the docs for this? |
Sure thing! |
Hello!
Closes #54720
This adds
*OfMany
support to theHasOneThrough
relationship:Thanks!