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(); }