Skip to content

Commit

Permalink
Update Model.php
Browse files Browse the repository at this point in the history
  • Loading branch information
papac authored Oct 27, 2023
1 parent f2b0ab8 commit 1676f73
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Database/Barry/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ private function writeRows(Builder $builder)
$primary_key_value = static::$builder->getPdo()->lastInsertId();
}

if (is_null($primary_key_value)) {
if (is_null($primary_key_value) || $primary_key_value == 0) {
$primary_key_value = $this->attributes[$this->primary_key] ?? null;
}

Expand Down

0 comments on commit 1676f73

Please sign in to comment.