Skip to content

Commit

Permalink
Fixed an issue where transforms always applied to the _id field
Browse files Browse the repository at this point in the history
  • Loading branch information
notheotherben committed Jun 18, 2015
1 parent 87bcce4 commit e091734
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions dist/lib/ModelSpecificInstance.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/lib/ModelSpecificInstance.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions lib/ModelSpecificInstance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ export default function ModelSpecificInstance<TDocument extends { _id?: any }, T
if (model.transforms.hasOwnProperty(property)) {
return Object.defineProperty(constructor.prototype, property, {
get: function () {
return model.transforms[property].fromDB(this._modified._id);
return model.transforms[property].fromDB(this._modified[property]);
},
set: function (value) {
this._modified._id = model.transforms[property].toDB(value);
this._modified[property] = model.transforms[property].toDB(value);
},
enumerable: true,
configurable: true
Expand Down

0 comments on commit e091734

Please sign in to comment.