docs: function (vm, callback) {
      if (this.isReplaying) {
        vm.actionOnCommitForReplay = vm.actionOnCommit;
        // Clone the values to be sure no reference mistakes happen!
        if (vm.attributes) {
          var flatAttr = flatten(vm.attributes);
          var undefines = [];
          _.each(flatAttr, function (v, k) {
            if (v === undefined) {
              undefines.push(k);
            }
          });
          vm.attributes = vm.toJSON();
          _.each(undefines, function (k) {
            vm.set(k, undefined);
          });
        }
  
        this.replayingVms[vm.id] = vm;
        if (vm.actionOnCommit === 'delete') {
          delete this.replayingVms[vm.id];
          if (!this.replayingVmsToDelete[vm.id]) this.replayingVmsToDelete[vm.id] = vm;
        }
        if (vm.actionOnCommit === 'create') {
          vm.actionOnCommit = 'update';
        }
        return callback(null);
      }
      this.repository.commit(vm, callback);
    }