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
When you remove a model that pertains to an Array of a related model, that array is updated by Ember Data but not stored unless you manually call the parent model save() method.
Currently I'm solving this issue with the following code, but I think this should be automatic?
Actually, I've noticed (not sure but it seems it started happening only this night) the adapter is not removing correctly the related information.
Example:
A Post has 4 Comments.
One of those Comments is removed by its author; we call comment.destroyRecord().
That call will also remove the comment from Post.comments.
Now post.comments has only 3 models, but still wasn't persisted.
We call post.save(). The adapter will send an addUnique operation with those 3 items, but this will not remove the 4th comment from the database, creating an inconsistency.
It seems there's no register of what items were removed anymore (hasMany._deletedItems).
When you remove a model that pertains to an Array of a related model, that array is updated by Ember Data but not stored unless you manually call the parent model
save()
method.Currently I'm solving this issue with the following code, but I think this should be automatic?
The text was updated successfully, but these errors were encountered: