Permalink
Browse files

Handle schemas as functions in NestedModel

  • Loading branch information...
1 parent 3a67a77 commit 1a6cd29a6d1321653bdae858c8b15bc428b4ed69 @powmedia committed Mar 23, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 src/backbone-forms.js
@@ -1396,6 +1396,9 @@
nestedModel = this.schema.model,
nestedModelSchema = (nestedModel).prototype.schema;
+ //Handle schema functions
+ if (_.isFunction(nestedModelSchema)) nestedModelSchema = nestedModelSchema();
+
this.form = new Form({
schema: nestedModelSchema,
model: new nestedModel(data),

0 comments on commit 1a6cd29

Please sign in to comment.