-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Eager loading in ActiveRecord::refresh() (without breaking BC) #20290
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
base: master
Are you sure you want to change the base?
Conversation
+ use array_column for faster mapping if no callbacks or grouping are required
+ changelog
+ also test with callbacks
! don't use array_column if ArrayHelper strings are paths + add according tests + add BaseStringHelper::contains() helper function and according tests
o code style fixes
! use strpos rather than polyfill - remove BaseStringHelper::contains
+ implementation with BC break
+ BC safe implementation
+ changelog
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #20290 +/- ##
=========================================
Coverage 64.85% 64.85%
- Complexity 11409 11411 +2
=========================================
Files 431 431
Lines 37142 37145 +3
=========================================
+ Hits 24087 24090 +3
Misses 13055 13055 ☔ View full report in Codecov by Sentry. |
foreach ($this->getPrimaryKey(true) as $key => $value) { | ||
$pk[$tableName . '.' . $key] = $value; | ||
} | ||
$args = func_get_args(); |
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.
I think passed arguments must be compatible with with()
:
$args = func_get_args();
if ($args) {
$query->with(...$args);
}
/** | ||
* {@inheritdoc} | ||
* | ||
* @param array $with If an array is passed to this function, |
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.
you can't be declared it as required parameter $with
I'll post a breaking but prettier implementation (for 2.2.x) in a separate pull request.