Fix the schema building
This commit is contained in:
parent
3830f0bfda
commit
4940187663
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue