Reputation: 293
With former versions of ember-data I could bring a modified model back to clear-state by calling:
user.transitionTo('loaded.saved')
Is there a way to do this in version 1.0beta.2? The main reason is to suppress any server requests when saying
user.save()
[Edit] - I didn't explicitly mention, that my intention was to keep the modified values, just resetting the dirty-state.
Upvotes: 1
Views: 701
Reputation: 293
What I really wanted to do is updating some fields of a record w/o setting the dirty flag.
store.update(type, hash)
here: http://emberjs.com/blog/2013/09/04/ember-data-1-0-beta-2-released.html does right that.
Upvotes: 1
Reputation: 1143
I responded over at Discourse, too, but for the sake of completeness:
user.rollback()
does what you aim to do, judging from the source code.
Upvotes: 0