Merge branch 'master' into clostridium

* master:
  Context-sensitive save-model mixin
This commit is contained in:
Matthew Dillon 2015-11-17 16:36:48 -07:00
commit d2c1609e86

View file

@ -23,11 +23,16 @@ export default Mixin.create({
cancel: function() {
const model = this.get('model');
const isNew = model.get('isNew');
model.get('errors').clear();
model.rollbackAttributes();
if (isNew) {
this.transitionToRoute(this.get('fallbackRouteCancel'));
} else {
this.transitionToRoute(this.get('fallbackRouteCancel'), model);
}
},
},
});