You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am having an issue with the many-to-many through association where I can't update properly. On update, it doesn't seem to be dropping the associations before writing the new ones. Thus, update() won't remove associations that aren't valid anymore.
In /api/controllers/AssignmentController I have the update function. I will pass in an array of Tag ids that omits some IDs that are present and adds some new ones. The new IDs are added correctly, but the old IDs aren't removed, which leads me to believe that the associations aren't dropping properly before the add.
What is confusing is that I can read/write fine from these associations. I can populate the Tag objects from the Assignment, and the .update() adds the new tags to the Assignment object fine.
Any idea what I am doing wrong here?
The text was updated successfully, but these errors were encountered:
Hey @chase-bleyl the nested association stuff is pretty wonky in Waterline 0.11. In the latest version that will ship with Sails v1 we went ahead and removed the nested "syncing" and added methods for adding, removing, and replacing associations.
We are working full speed to try and get that version out the door but I'll take a look when I get a spare minute and see if I can quickly track it down. All of these models are using the same database correct?
Waterline version: 0.11.9
Node version: 6.9.4
NPM version: 3.10.10
Operating system: macOS Sierra
I am having an issue with the many-to-many through association where I can't update properly. On update, it doesn't seem to be dropping the associations before writing the new ones. Thus,
update()
won't remove associations that aren't valid anymore.I have recreated this issue at https://github.com/chase-bleyl/test-update.
I have three models:
In
/api/controllers/AssignmentController
I have the update function. I will pass in an array of Tag ids that omits some IDs that are present and adds some new ones. The new IDs are added correctly, but the old IDs aren't removed, which leads me to believe that the associations aren't dropping properly before the add.What is confusing is that I can read/write fine from these associations. I can populate the Tag objects from the Assignment, and the
.update()
adds the new tags to the Assignment object fine.Any idea what I am doing wrong here?
The text was updated successfully, but these errors were encountered: