Fix mongoose adapter find
This commit is contained in:
parent
2ce44db4ba
commit
881a5b49fc
|
@ -595,7 +595,7 @@ AbstractClass.prototype.fromObject = function (obj) {
|
||||||
* @return Boolean
|
* @return Boolean
|
||||||
*/
|
*/
|
||||||
AbstractClass.prototype.propertyChanged = function propertyChanged(attr) {
|
AbstractClass.prototype.propertyChanged = function propertyChanged(attr) {
|
||||||
return this.hasOwnProperty(attr + '_was') && this['_' + attr] !== this[attr + '_was'];
|
return this['_' + attr] !== this[attr + '_was'];
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -101,7 +101,7 @@ MongooseAdapter.prototype.find = function find(model, id, callback) {
|
||||||
delete this.cache[model][id];
|
delete this.cache[model][id];
|
||||||
this.getCached(model, id, function (err, data) {
|
this.getCached(model, id, function (err, data) {
|
||||||
if (err) return callback(err);
|
if (err) return callback(err);
|
||||||
callback(err, data);
|
callback(err, data ? data.toObject() : null);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue