Skip to content

Commit 7d0f73d

Browse files
committed
fix: check for circular relations for each models not only current;
1 parent 4d1596e commit 7d0f73d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Generators/TestsGenerator.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,11 +236,11 @@ protected function buildRelationsTree($models)
236236
continue;
237237
}
238238

239-
if (in_array($this->model, $relations)) {
239+
if (in_array($model, $relations)) {
240240
$this->throwFailureException(
241241
CircularRelationsFoundedException::class,
242-
"Circular relations founded.",
243-
"Please resolve you relations in models, factories and database."
242+
'Circular relations founded.',
243+
'Please resolve you relations in models, factories and database.'
244244
);
245245
}
246246

0 commit comments

Comments
 (0)