Merge pull request #170 from saschagehlich/additional_types

add additional types stored in Schema.types to schema context
This commit is contained in:
Anatoliy Chakkaev 2012-12-16 09:53:15 -08:00
commit b7a3b297e7
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;