From c074e2b88023858bcbb3802db15e522ab2017db7 Mon Sep 17 00:00:00 2001 From: Michael Nardolillo Date: Wed, 11 Sep 2019 11:30:35 -0700 Subject: [PATCH] Update src/Jenssegers/Mongodb/Relations/EmbedsMany.php Co-Authored-By: Jens Segers --- src/Jenssegers/Mongodb/Relations/EmbedsMany.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Jenssegers/Mongodb/Relations/EmbedsMany.php b/src/Jenssegers/Mongodb/Relations/EmbedsMany.php index 3c720b73d..85574eeb0 100644 --- a/src/Jenssegers/Mongodb/Relations/EmbedsMany.php +++ b/src/Jenssegers/Mongodb/Relations/EmbedsMany.php @@ -237,7 +237,7 @@ public function attach(Model $model) protected function associateNew($model) { // Create a new key if needed. - if ($model->getKeyName() == '_id' && !$model->getAttribute('_id')) { + if ($model->getKeyName() === '_id' && !$model->getAttribute('_id')) { $model->setAttribute('_id', new ObjectID); }