From 339af87267d355a8acef6dafbed9d2f2523099d2 Mon Sep 17 00:00:00 2001 From: Marc Jauvin Date: Mon, 29 Jul 2024 16:27:05 -0400 Subject: [PATCH] Use fromRawAttributes() for custom pivot models (#184) Fixes wintercms/winter#741. Related: https://github.com/wintercms/wn-test-plugin/pull/11 --- src/Database/Model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Database/Model.php b/src/Database/Model.php index 40390596..8dfcc382 100644 --- a/src/Database/Model.php +++ b/src/Database/Model.php @@ -853,7 +853,7 @@ public function newRelationPivot($relationName, $parent, $attributes, $table, $e if (!is_null($definition) && array_key_exists('pivotModel', $definition)) { $pivotModel = $definition['pivotModel']; - return $pivotModel::fromAttributes($parent, $attributes, $table, $exists); + return $pivotModel::fromRawAttributes($parent, $attributes, $table, $exists); } }