Skip to content

Commit

Permalink
Some fixes and tweaks to Instance and Model
Browse files Browse the repository at this point in the history
  • Loading branch information
notheotherben committed Apr 24, 2015
1 parent f4f9d9b commit a020f4f
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 127 deletions.
7 changes: 5 additions & 2 deletions lib/Instance.js

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

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

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

6 changes: 5 additions & 1 deletion lib/Instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,11 @@ class Instance<TDocument, TInstance> {
});
}).then((changed: boolean) => {
conditions = this._model.helpers.selectOne(this._modified);
if (!changed) return this._modified;
if (!changed) {
var document = _.cloneDeep(this._modified);
this._model.helpers.transform.reverse(document);
return document;
}

return new Promise<TDocument>((resolve, reject) => {
this._model.collection.findOne(conditions,(err: Error, latest) => {
Expand Down

0 comments on commit a020f4f

Please sign in to comment.