Fix inherit bug
This commit is contained in:
parent
2de55df939
commit
0aa0cabdd4
|
@ -120,24 +120,25 @@ ModelBuilder.prototype.define = function defineClass(className, properties, sett
|
|||
}
|
||||
};
|
||||
|
||||
// mix in EventEmitter
|
||||
// mix in EventEmitter (dont inherit from)
|
||||
var events = new EventEmitter();
|
||||
ModelClass.on = events.on.bind(events);
|
||||
ModelClass.once = events.once.bind(events);
|
||||
ModelClass.emit = events.emit.bind(events);
|
||||
ModelClass.setMaxListeners = events.setMaxListeners.bind(events);
|
||||
|
||||
hiddenProperty(ModelClass, 'schema', schema);
|
||||
hiddenProperty(ModelClass, 'modelName', className);
|
||||
hiddenProperty(ModelClass, 'pluralModelName', pluralName || i8n.pluralize(className));
|
||||
hiddenProperty(ModelClass, 'relations', {});
|
||||
|
||||
util.inherits(ModelClass, ModelBaseClass);
|
||||
|
||||
// inherit ModelBaseClass methods
|
||||
// inherit ModelBaseClass static methods
|
||||
for (var i in ModelBaseClass) {
|
||||
ModelClass[i] = ModelBaseClass[i];
|
||||
}
|
||||
|
||||
util.inherits(ModelClass, ModelBaseClass);
|
||||
|
||||
ModelClass.getter = {};
|
||||
ModelClass.setter = {};
|
||||
standartize(properties, settings);
|
||||
|
|
Loading…
Reference in New Issue