Skip to content

Conversation

jim5359
Copy link
Contributor

@jim5359 jim5359 commented Apr 2, 2019

This PR fixes #1749

I have a situation where I don't want my EmbedsMany objects to have an _id attribute. Normally I can just set the $primaryKey = null on my object. But EmbedsMany is not respecting this on new associations. This change fixes that.

@jim5359
Copy link
Contributor Author

jim5359 commented Sep 3, 2019

Can someone please review this simple PR so it can get merged? Thanks.

@jenssegers
Copy link
Contributor

Looks good, would just replace the == sign with a more strict check. Bonus points if you add a test as well!

@jim5359
Copy link
Contributor Author

jim5359 commented Sep 3, 2019

Thanks, I will update the PR.

@jim5359
Copy link
Contributor Author

jim5359 commented Sep 11, 2019

Sorry, I'm fairly new to GitHub PRs and didn't realize I could just accept your suggestion. Done.

@Smolevich
Copy link
Contributor

Smolevich commented Sep 11, 2019

@jim5359, if you ready, please to join slack and notify Jens in channel review

@jenssegers jenssegers merged commit f3f230a into mongodb:master Sep 12, 2019
@jim5359
Copy link
Contributor Author

jim5359 commented Sep 12, 2019

Thank you for merging!

mnphpexpert added a commit to mnphpexpert/laravel-mongodb that referenced this pull request Sep 2, 2024
EmbedsMany respect primaryKey on association
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.

EmbedsMany objects without _id attribute

3 participants