Sometimes in my Ember app I create some records with createRecord, but I don't want to store all of them on the server. So I call destroy
on the objects I don't need before calling store.commit()
. Yet, they are sent to the server nonetheless. How do you prevent this?
I have tried to commit
in the "next" Ember run but it does not work either:
... do some clean up ...
Ember.run.next(self, function() {
self.store.commit(); // The destroyed objects are committed nonetheless
});
Thanks!
PJ