How to rollback relationship changes in EmberData

后端 未结 4 1078
春和景丽
春和景丽 2020-12-31 19:08

I have two models with parent-child relationship: training and exercise:

App.Training = DS.Model.extend({
  exercises:         


        
4条回答
  •  孤城傲影
    2020-12-31 19:32

    Late to the party, but here we go:

    I created an addon that resolves this issue. Just call rollbackRelationships() and it will rollback all your relationships (belongsTo & hasMany). Look at the README for more options.

    https://www.npmjs.com/package/ember-rollback-relationships

提交回复
热议问题