Add proper type registration
This commit is contained in:
parent
5a1df1b418
commit
35571dcd58
|
@ -231,7 +231,6 @@ function prepareContext(models, railway, app, defSchema, done) {
|
|||
ctx[typeName] = Schema.types[typeName];
|
||||
}
|
||||
}
|
||||
ctx.Text = Schema.Text;
|
||||
|
||||
return ctx;
|
||||
|
||||
|
|
|
@ -19,6 +19,18 @@ exports.Schema = Schema;
|
|||
*/
|
||||
var slice = Array.prototype.slice;
|
||||
|
||||
Schema.Text = function Text() {};
|
||||
Schema.JSON = function JSON() {};
|
||||
|
||||
Schema.types = {};
|
||||
Schema.registerType = function (type) {
|
||||
this.types[type.name] = type;
|
||||
};
|
||||
|
||||
Schema.registerType(Schema.Text);
|
||||
Schema.registerType(Schema.JSON);
|
||||
|
||||
|
||||
/**
|
||||
* Schema - adapter-specific classes factory.
|
||||
*
|
||||
|
@ -107,11 +119,6 @@ function Schema(name, settings) {
|
|||
|
||||
util.inherits(Schema, require('events').EventEmitter);
|
||||
|
||||
function Text() {}
|
||||
Schema.Text = Text;
|
||||
function JSON() {}
|
||||
Schema.JSON = JSON;
|
||||
|
||||
/**
|
||||
* Define class
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue