-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sync method not removing ids in belongsToMany relationship #72
Comments
Maybe @dyeh could pitch in? I will take a look at it as well. |
I also tested out the attach / detach methods and got the same result as using the sync method $user = User::find("5294f9d695463439088b4569");
$user->roles()->attach("52953c599546345b048b456a");
// the above code puts the Role id on the User document, as expected.
// it also puts the User id on the Role document, as expected.
// later on...
$user->roles()->detach("52953c599546345b048b456a");
// that line removes the Role id from the User document
// but it does not remove the User id from the Role document |
Will look into this, I did test this and it seemed to work ok. |
If you add this it will fail:
|
Pull request 57c5bed should fix this |
Works incredibly well. Beaming with joy. Thank you! |
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have User and Role models, with each one having a belongsToMany relationship with the other, i.e. User belongsToMany Role and Role belongsToMany User.
Consider the following example:
Shouldn't the User id be removed from the Role documents when the sync method passes an empty array? Or is that not what sync is meant to do?
The text was updated successfully, but these errors were encountered: