Skip to content

Conversation

alexandre-butynski
Copy link
Contributor

This could happen when you get data directly from a form.

Come from #138. I will propose you smaller pull requests in order to make easier reviews, discussions and eventually rejections.

@jenssegers
Copy link
Contributor

I think this might be fixed by using:

if ( ! $model->getAttribute('_id'))

Will try that out with your new test.

jenssegers added a commit that referenced this pull request Mar 4, 2014
MongoId creation of embedded models edge case
@jenssegers jenssegers merged commit b5efc30 into mongodb:master Mar 4, 2014
jenssegers added a commit that referenced this pull request Mar 4, 2014
@jenssegers
Copy link
Contributor

This tweak will now only cause getAttribute('_id') to be called once instead of twice in these edge cases.

@alexandre-butynski
Copy link
Contributor Author

Great !

@alexandre-butynski alexandre-butynski deleted the master-empty-embedded-mongoid branch March 4, 2014 12:52
mnphpexpert added a commit to mnphpexpert/laravel-mongodb that referenced this pull request Sep 2, 2024
MongoId creation of embedded models edge case
mnphpexpert added a commit to mnphpexpert/laravel-mongodb that referenced this pull request Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants