(patch, targetModel, options)
| 41 | } |
| 42 | |
| 43 | constructor (patch, targetModel, options) { |
| 44 | super(options) |
| 45 | this.patch = patch |
| 46 | this.targetModel = targetModel |
| 47 | const targetID = this.patch.get('target').id |
| 48 | if (targetID === this.targetModel.id) { |
| 49 | this.originalSource = this.targetModel.clone(false) |
| 50 | } else { |
| 51 | this.originalSource = new this.targetModel.constructor({ _id: targetID }) |
| 52 | this.supermodel.loadModel(this.originalSource) |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | applyDelta () { |
| 57 | this.headModel = null |