Skip to content

Commit 69bc78f

Browse files
authored
Merge pull request #347 from bowphp/refactor/code-base
fix: set model dabase connexion
2 parents df41535 + 65e177b commit 69bc78f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/Database/Barry/Model.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,7 @@ public function __construct(array $attributes = [])
164164

165165
$this->original = $attributes;
166166

167-
if ($this->connection !== null) {
168-
$this->setConnection(DB::getConnectionName());
169-
}
167+
$this->setConnection($this->connection ?: DB::getConnectionName());
170168

171169
$this->table = static::query()->getTable();
172170
}

0 commit comments

Comments
 (0)