Is there a way to prevent backbone from clearing out the changedAttributes object after changing a property (backbone version > 1). I simply try to increment a version attribute of a model when the model has changed after adding some data and then sync the model with all its changed attributes to the server;
var version = model.get('version');
model.set(data);
if(model.changedAttributes()) {
model.set('version', version+1);
model.save();
}
However since backbone cleared previous changes after the second set and in my backbone sync function i only post changedAttributes backbone will only posts the version attribute. So is there a way to changed and attribute and add it to the changed attribute object without clearing it. Otherwise i would be forced to make an extra server call for adding version