Skip to content

Commit 4ae4a7c

Browse files
jim5359jenssegers
andauthored
Update src/Jenssegers/Mongodb/Relations/EmbedsMany.php
Co-Authored-By: Jens Segers <[email protected]>
1 parent 4cd4317 commit 4ae4a7c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Jenssegers/Mongodb/Relations/EmbedsMany.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ public function attach(Model $model)
237237
protected function associateNew($model)
238238
{
239239
// Create a new key if needed.
240-
if ($model->getKeyName() == '_id' && !$model->getAttribute('_id')) {
240+
if ($model->getKeyName() === '_id' && !$model->getAttribute('_id')) {
241241
$model->setAttribute('_id', new ObjectID);
242242
}
243243

0 commit comments

Comments
 (0)