Skip to content

Commit

Permalink
Fixed for use of type as a key
Browse files Browse the repository at this point in the history
  • Loading branch information
rauchg committed Mar 25, 2011
1 parent c66aab1 commit df2dc8b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/mongoose/schema.js
Expand Up @@ -97,7 +97,7 @@ Schema.prototype.add = function (obj, prefix) {
if (!prefix && !this.tree[i]) if (!prefix && !this.tree[i])
this.tree[i] = obj[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) if (Object.keys(obj[i]).length)
this.add(obj[i], prefix + i + '.'); this.add(obj[i], prefix + i + '.');
else else
Expand Down

0 comments on commit df2dc8b

Please sign in to comment.