4
votes

See JSFiddle: http://jsfiddle.net/cyclomarc/HKHEJ/2/

I am converting from Ember data 0.13 to 1.0.0 beta. In previous versions you could use transaction.rollback() to revert any changes made in a model (and not yet saved).

In 1.0.0 you can use record.rollback(). The problem I have is that all attributes are cleared at that moment ...

 cancel: function () {
      var author = this.get('model');
      author.rollback();
    },  

Scenario in JSFiddle: click on a name, change the text in one of the textfields, then click "Revert changes". All fields are cleared, except the id.

Is this a known issue ?

1

1 Answers

5
votes

Yes this is a known issue, it was fixed in commit Add support for rollback

I updated your jsfiddle to use ember-data-latest and rollback now works as expected: http://jsfiddle.net/cyclomarc/HKHEJ/2/

  author.rollback();