Permalink
Browse files

set properties of wrapped objects explicitly

  • Loading branch information...
JoshuaGross committed Jan 10, 2013
1 parent 75e04e0 commit a673c30d5032ecb204f1ad40877d896f8f498ca1
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/mongoose-subpopulate.js
@@ -288,6 +288,12 @@ var wrapSchema = exports.wrapSchema = function wrapSchema (schema) {
newSchema.prototype.__proto__ = schema;
newSchema.mSubpopulateWrappedConstructor = true;
+ for (var i in schema) {
+ if (schema.hasOwnProperty(i) && !newSchema[i]) {
+ newSchema[i] = schema[i];
+ }
+ }
+
return newSchema;
}

0 comments on commit a673c30

Please sign in to comment.