From 8c3d8d837d79d50adf1bd43e2f6cf5bded8ef849 Mon Sep 17 00:00:00 2001 From: Max Loeb Date: Tue, 24 Oct 2023 20:31:47 -0700 Subject: [PATCH] don't collect models if not needed --- lib/Table.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/Table.php b/lib/Table.php index 62ba2814..f363621f 100644 --- a/lib/Table.php +++ b/lib/Table.php @@ -316,10 +316,9 @@ public function find_by_sql(string $sql, array $values = [], bool $readonly = fa if ($collect_attrs_for_includes) { $attrs[] = $model->attributes(); + $list[] = $model; } - $list[] = $model; - yield $model; }