Skip to content

Commit

Permalink
Remove Eloquent\Builder::chunkById() already having the correct id fi…
Browse files Browse the repository at this point in the history
…eld in laravel (#2569)
  • Loading branch information
GromNaN authored Aug 23, 2023
1 parent 7d3be9f commit b484288
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
8 changes: 0 additions & 8 deletions src/Eloquent/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,6 @@ public function decrement($column, $amount = 1, array $extra = [])
return parent::decrement($column, $amount, $extra);
}

/**
* @inheritdoc
*/
public function chunkById($count, callable $callback, $column = '_id', $alias = null)
{
return parent::chunkById($count, $callback, $column, $alias);
}

/**
* @inheritdoc
*/
Expand Down
8 changes: 4 additions & 4 deletions tests/ModelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
});

$this->assertEquals(3, $count);
$this->assertEquals(['fork', 'spork', 'spoon'], $names);
}

public function testTruncateModel()
Expand Down

0 comments on commit b484288

Please sign in to comment.