Skip to content

Commit

Permalink
fix: Correctly apply $document.toDB to saved instances
Browse files Browse the repository at this point in the history
  • Loading branch information
notheotherben committed Dec 15, 2015
1 parent eeb6650 commit 47ac927
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/Instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ export class Instance<TDocument extends { _id?: any }, TInstance> {

var original = this._model.helpers.cloneDocument(this._original);
var modified = this._model.helpers.cloneDocument(this._modified);

modified = this._model.helpers.transformToDB(modified, { document: true });

changes = this._model.helpers.diff(original, modified);
}
Expand Down

0 comments on commit 47ac927

Please sign in to comment.