Skip to content

Commit

Permalink
Fixed issues with Instance.save(conditions, changes) when conditions …
Browse files Browse the repository at this point in the history
…didn't match anything
  • Loading branch information
notheotherben committed Jan 15, 2014
1 parent c2787d8 commit dc745c1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/Instance.js
Expand Up @@ -157,6 +157,7 @@ Instance.prototype.save = function(conditions, changes, callback) {
if(err) return onError(err);
if(!changed) return (callback || function() { })(null, this);

var conditions = this.__state.model.uniqueConditions(this.__state.modified);
this.__state.model.collection.findOne(conditions, (function(err, latest) {
if(err) return onError(err);

Expand Down

0 comments on commit dc745c1

Please sign in to comment.