add additional types stored in Schema.types to schema context

This commit is contained in:
Sascha Gehlich 2012-12-16 14:29:53 +01:00
parent 9fed918db8
commit 53e2dcf30b
1 changed files with 9 additions and 0 deletions

View File

@ -201,6 +201,15 @@ function prepareContext(models, railway, app, defSchema, done) {
if (cname) settings[cname].table = name;
};
/**
* If the Schema has additional types, add them to the context
* e.g. MySQL has an additional Point type
*/
if (Schema.types && Object.keys(Schema.types).length) {
for (var typeName in Schema.types) {
ctx[typeName] = Schema.types[typeName];
}
}
ctx.Text = Schema.Text;
return ctx;