I have a rollbackAll () method in my application that does a depth traversal using get and promises and then collapses them all back before rolling back the parent. It looks like this:
rollbackAll: function() {
this.get('children').then(function (children) {
children.forEach(function(child) {
child.rollbackAll();
});
});
this.rollback();
}
I should mention this because there is a recursive relationship in my application (i.e. a tree of objects, each of which may have its own parent).
, "" rollbackAll, , , rollbackAll() . ( , ).