Permalink
Browse files

Fixed for use of `type` as a key

  • Loading branch information...
1 parent c66aab1 commit df2dc8bd3a42462746f746b64dea3812b5d038a2 @rauchg rauchg committed Mar 25, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/mongoose/schema.js
View
@@ -97,7 +97,7 @@ Schema.prototype.add = function (obj, prefix) {
if (!prefix && !this.tree[i])
this.tree[i] = obj[i];
- if (obj[i].constructor == Object && (!obj[i].type || obj[i].__nested)) {
+ if (obj[i].constructor == Object && (!obj[i].type || obj[i].type.type)) {
if (Object.keys(obj[i]).length)
this.add(obj[i], prefix + i + '.');
else

0 comments on commit df2dc8b

Please sign in to comment.