Ensure changes are created in sync

This commit is contained in:
Ritchie Martori 2014-05-20 12:46:43 -07:00
parent 52eb72d94f
commit 77bd77e625
1 changed files with 6 additions and 6 deletions

View File

@ -882,13 +882,13 @@ DataModel.enableChangeTracking = function() {
Change.attachTo(this.dataSource);
Change.getCheckpointModel().attachTo(this.dataSource);
Model.on('changed', function(obj) {
Model.rectifyChange(obj.getId(), Model.handleChangeError);
});
Model.afterSave = function afterSave(next) {
Model.rectifyChange(this.getId(), next);
}
Model.on('deleted', function(id) {
Model.rectifyChange(id, Model.handleChangeError);
});
Model.afterDestroy = function afterDestroy(next) {
Model.rectifyChange(this.getId(), next);
}
Model.on('deletedAll', cleanup);