Fixed metaschemas not being found.

This commit is contained in:
Scott Erickson 2014-08-28 15:54:05 -07:00
parent 8f95ad2787
commit 608d114c5c

View file

@ -72,7 +72,10 @@ class CocoModel extends Backbone.Model
buildAttributesWithDefaults: ->
t0 = new Date()
clone = $.extend true, {}, @attributes
TreemaNode.utils.populateDefaults(clone, @schema())
thisTV4 = tv4.freshApi()
thisTV4.addSchema('#', @schema())
thisTV4.addSchema('metaschema', require('schemas/metaschema'))
TreemaNode.utils.populateDefaults(clone, @schema(), thisTV4)
@attributesWithDefaults = clone
console.debug "Populated defaults for #{@attributes.name or @type()} in #{new Date() - t0}ms"