Fix the schema building

This commit is contained in:
Raymond Feng 2013-06-21 14:15:24 -07:00
parent 3830f0bfda
commit 4940187663
1 changed files with 5 additions and 2 deletions

View File

@ -170,13 +170,13 @@ ModelBuilder.prototype.define = function defineClass(className, properties, sett
};
ModelClass.attachTo = function (dataSource) {
dataSource.attach(this);
dataSource.attach(this);
}
ModelClass.registerProperty = function (attr) {
var DataType = properties[attr].type;
if(!DataType) {
console.error('Not found: ' + attr);
throw new Error('Invalid type for property ' + attr);
}
if (DataType instanceof Array) {
DataType = List;
@ -402,7 +402,10 @@ function getSchemaType(type) {
console.error(type);
throw new Error('Missing type property');
}
} else if('function' === typeof type ) {
return type;
}
return type;
}
/**