Skip to content

Commit

Permalink
Fixed wrap:false behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
notheotherben committed Apr 16, 2014
1 parent 6a7807e commit 87ec984
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/Model.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,10 @@ Model.prototype.onRetrieved = function(conditions, results, callback, wrapper, o
this.emit('retrieved', target);

var cacheDoc = _.cloneDeep(target);
var wrapped = target;

var wrapped = options.wrap ? wrapper(target, false, options.partial) : this.fromSource(target);
if(options.wrap) wrapped = wrapper(target, false, options.partial);
else this.fromSource(wrapped);

doHook(this.options.hooks.ready, wrapped, (function(err) {
if(err) {
Expand Down

0 comments on commit 87ec984

Please sign in to comment.