becomeInvalid 状態の場合、('loaded.created.uncommitted') 状態に遷移した後、ストアの defaultTransactionを使用して再コミットする必要があります。
以下のコードを参照してください - transaction.commit() または defaultTransaction.commit() を使用するかどうかを知るための非常に汚いチェック
save: function () {
//Local commit - author record goes in Flight state
this.transaction.commit();
//After a becameInvalid state, transaction.commit() does not work; use defaultTransaction in that case
//Is this the only way to do this ?
if (this.get('stateManager.currentState.name') == "uncommitted") {
this.get('store').get("defaultTransaction").commit();
}
var author = this.get('model');
author.one('didCreate', this, function () {
this.transitionToRoute('author.edit', author);
});
//If response is error (e.g. REST API not accessible): becameError fires
author.one('becameError', this, function () {
this.get('stateManager').transitionTo('loaded.created.uncommitted');
});
//If response is 422 (validation problem at server side): becameInvalid fires
author.one('becameInvalid', this, function () {
this.set('errors', this.get('content.errors'));
//Does set stateManager.currentState.name to uncommitted, but when committing again, nothing happens.
this.get('stateManager').transitionTo('loaded.created.uncommitted')
});
}、