From 53e2dcf30bd7dd1f0bfd5bdcbaabd1646e0f102e Mon Sep 17 00:00:00 2001 From: Sascha Gehlich Date: Sun, 16 Dec 2012 14:29:53 +0100 Subject: [PATCH] add additional types stored in Schema.types to schema context --- lib/railway.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/railway.js b/lib/railway.js index bc54a920..d8ac0203 100644 --- a/lib/railway.js +++ b/lib/railway.js @@ -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;