From 65e177b907a2910ea3ec5a055132a919fd9629c8 Mon Sep 17 00:00:00 2001 From: Franck DAKIA Date: Sun, 28 Dec 2025 14:34:32 +0000 Subject: [PATCH] fix: set model dabase connexion --- src/Database/Barry/Model.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Database/Barry/Model.php b/src/Database/Barry/Model.php index f34105e9..813ac981 100644 --- a/src/Database/Barry/Model.php +++ b/src/Database/Barry/Model.php @@ -164,9 +164,7 @@ public function __construct(array $attributes = []) $this->original = $attributes; - if ($this->connection !== null) { - $this->setConnection(DB::getConnectionName()); - } + $this->setConnection($this->connection ?: DB::getConnectionName()); $this->table = static::query()->getTable(); }