Skip to content

Commit

Permalink
Fix delete parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
micoli committed Jul 15, 2023
1 parent d40045f commit 66b002d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Elql.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function delete(string $model, string $where = null, array $parameters =
{
$this->persister->updateRecords($model, array_values(array_filter(
$this->persister->getRecords($model)->data,
fn (mixed $record) => !$this->match($record, $where),
fn (mixed $record) => !$this->match($record, $where, $parameters),
)));
}

Expand Down
2 changes: 1 addition & 1 deletion tests/ElqlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function testACompleteScenarioPass(): void
$records = $this->database->find(Baz::class, 'record.id==3');
self::assertSame('c-updated', $records[0]->firstName);

$this->database->delete(Baz::class, 'record.id in [1,4]');
$this->database->delete(Baz::class, 'record.id in ids', ['ids' => [1, 4]]);
$this->database->add(new Foo(2, 'bb', new DateTimeImmutable()));
self::assertSame(2, $this->database->count(Baz::class));
self::assertSame(2, $this->database->count(Foo::class));
Expand Down

0 comments on commit 66b002d

Please sign in to comment.