Skip to content

Commit

Permalink
Fix missing function issue (laravel#711)
Browse files Browse the repository at this point in the history
* Fix missing function issue

`getUnqualifiedScoutKeyName` doesn't exist anymore. Since `getScoutKeyName` sends back to `\Illuminate\Database\Eloquent\Model::getKeyName` which is unqualified, the fix is straightforward.

* Update MeilisearchEngineTest.php
  • Loading branch information
JerryBels authored Mar 5, 2023
1 parent caa2937 commit 961d599
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Engines/MeilisearchEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ public function mapIdsFrom($results, $key)
*/
public function keys(Builder $builder)
{
$scoutKey = $builder->model->getUnqualifiedScoutKeyName();
$scoutKey = $builder->model->getScoutKeyName();

return $this->mapIdsFrom($this->search($builder), $scoutKey);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/MeilisearchEngineTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ public function test_returns_primary_keys_when_custom_array_order_present()
$builder = m::mock(Builder::class);

$model = m::mock(stdClass::class);
$model->shouldReceive(['getUnqualifiedScoutKeyName' => 'custom_key']);
$model->shouldReceive(['getScoutKeyName' => 'custom_key']);
$builder->model = $model;

$engine->shouldReceive('keys')->passthru();
Expand Down

0 comments on commit 961d599

Please sign in to comment.