Skip to content

Commit b6a7511

Browse files
committed
wip
1 parent a0cd7c3 commit b6a7511

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

packages/database/src/Mappers/SelectModelMapper.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,7 @@ private function values(ModelInspector $model, array $data): array
5555
$relation = $model->getRelation($key);
5656

5757
if ($relation instanceof BelongsTo) {
58-
$relationModel = inspect($relation);
59-
60-
if (($data[$relation->name][$relationModel->getPrimaryKeyProperty()->getName()] ?? null) === null) {
58+
if ($relation->property->isNullable() && array_filter($data[$relation->name] ?? []) === []) {
6159
$data[$relation->name] = null;
6260
}
6361

0 commit comments

Comments
 (0)