We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4cd4317 commit 4ae4a7cCopy full SHA for 4ae4a7c
src/Jenssegers/Mongodb/Relations/EmbedsMany.php
@@ -237,7 +237,7 @@ public function attach(Model $model)
237
protected function associateNew($model)
238
{
239
// Create a new key if needed.
240
- if ($model->getKeyName() == '_id' && !$model->getAttribute('_id')) {
+ if ($model->getKeyName() === '_id' && !$model->getAttribute('_id')) {
241
$model->setAttribute('_id', new ObjectID);
242
}
243
0 commit comments