Is it possible to revert the model to a clean state? I mean undo all the changes to its properties and mark the state as being clean?
Ember-Data now has an awesome implementation of this. They utilize the transaction class to manage the changes to your objects, which imo is the right place for this. To rollback changes on a model:
Obtain the Model
// if PostController is a ArrayController or ArrayProxy
p = App.PostController.objectAt(0);
Get the object's associated transaction instance and call it's rollback() method.
p.get("transaction").rollback();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With