I am dealing with a threaded comments collection, and when I delete a comment that has children, I do model.destroy()
for this comment, and on the server side all its branches get deleted.
I wrote a function that once a node is deleted from the tree, looks for all orphans and removes them too. So when I find orphans, I run model.destroy()
on them too but because they're already deleted on the server, sync returns errors.
Is there a way to disable sync for some destroy()
calls?
.sync()
and adding some extra logic for thedelete
method would be overkill for this, or if there is a cleaner way. – Aa