-
Couldn't load subscription status.
- Fork 1.4k
Remove Eloquent\Builder::chunkById() already having the correct id field in Laravel
#2569
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -834,12 +834,12 @@ public function testChunkById(): void | |
| User::create(['name' => 'spork', 'tags' => ['sharp', 'pointy', 'round', 'bowl']]); | ||
| User::create(['name' => 'spoon', 'tags' => ['round', 'bowl']]); | ||
|
|
||
| $count = 0; | ||
| User::chunkById(2, function (EloquentCollection $items) use (&$count) { | ||
| $count += count($items); | ||
| $names = []; | ||
| User::chunkById(2, function (EloquentCollection $items) use (&$names) { | ||
| $names = array_merge($names, $items->pluck('name')->all()); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I noted your response in GromNaN/laravel-mongodb#25 (comment). Not sure why I thought |
||
| }); | ||
|
|
||
| $this->assertEquals(3, $count); | ||
| $this->assertEquals(['fork', 'spork', 'spoon'], $names); | ||
| } | ||
|
|
||
| public function testTruncateModel() | ||
|
|
||
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.
Noted your response in GromNaN/laravel-mongodb#25 (comment).
I missed that the meaningful change here was removing the
_idparameter default value, since Laravel now consults the configured primary key (laravel/framework#28065).