Skip to content

Commit

Permalink
fixed; { path: [{type: "String" }] }
Browse files Browse the repository at this point in the history
  • Loading branch information
aheckmann committed Feb 27, 2013
1 parent dce0fdd commit b56c949
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/schema/array.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,15 @@ function SchemaArray (key, cast, options) {
}
}

var caster = cast.name in Types ? Types[cast.name] : cast;
// support { type: 'String' }
var name = 'string' == typeof cast
? cast
: cast.name;

var caster = name in Types
? Types[name]
: cast;

this.casterConstructor = caster;
this.caster = new caster(null, castOptions);
if (!(this.caster instanceof EmbeddedDoc)) {
Expand Down

0 comments on commit b56c949

Please sign in to comment.