Fix mongoose adapter find

This commit is contained in:
Anatoliy Chakkaev 2012-04-11 23:39:11 +04:00
parent 2ce44db4ba
commit 881a5b49fc
2 changed files with 2 additions and 2 deletions

View File

@ -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'];
}; };
/** /**

View File

@ -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);
}); });
}; };