Skip to content

Commit c6b43fd

Browse files
authored
Merge pull request #2 from justbetter/feature/only-update-open
Also update where the operation status is still null
2 parents d938910 + 5e05a9a commit c6b43fd

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/Actions/UpdateBulkStatuses.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ public function update(): void
1515
{
1616
BulkRequest::query()
1717
->whereHas('operations', function (Builder $query): void {
18-
$query->where('status', '=', OperationStatus::Open);
18+
$query
19+
->where('status', '=', OperationStatus::Open)
20+
->orWhereNull('status');
1921
})
2022
->get()
2123
->each(fn (BulkRequest $bulkRequest): PendingDispatch => UpdateBulkStatusJob::dispatch($bulkRequest));

tests/Actions/UpdateBulkStatusesTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function it_can_update_bulk_statuses(): void
5454

5555
$status2->operations()->create([
5656
'operation_id' => 1,
57-
'status' => OperationStatus::Open,
57+
'status' => null,
5858
]);
5959

6060
$status3->operations()->create([

0 commit comments

Comments
 (0)