Fix inheritance
This commit is contained in:
parent
e6be50eb81
commit
c27a624d02
|
@ -106,9 +106,6 @@ AbstractClass.prototype._initProperties = function (data, applySetters) {
|
|||
this.trigger("initialize");
|
||||
}
|
||||
|
||||
AbstractClass.setter = {};
|
||||
AbstractClass.getter = {};
|
||||
|
||||
/**
|
||||
* @param {String} prop - property name
|
||||
* @param {Object} params - various property configuration
|
||||
|
|
|
@ -158,9 +158,16 @@ Schema.prototype.define = function defineClass(className, properties, settings)
|
|||
hiddenProperty(NewClass, 'cache', {});
|
||||
hiddenProperty(NewClass, 'mru', []);
|
||||
|
||||
// setup inheritance
|
||||
NewClass.__proto__ = AbstractClass;
|
||||
util.inherits(NewClass, AbstractClass);
|
||||
// inherit AbstractClass methods
|
||||
for (var i in AbstractClass) {
|
||||
NewClass[i] = AbstractClass[i];
|
||||
}
|
||||
for (var j in AbstractClass.prototype) {
|
||||
NewClass.prototype[j] = AbstractClass.prototype[j];
|
||||
}
|
||||
|
||||
NewClass.getter = {};
|
||||
NewClass.setter = {};
|
||||
|
||||
// store class in model pool
|
||||
this.models[className] = NewClass;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "jugglingdb",
|
||||
"description": "ORM for every database: redis, mysql, neo4j, mongodb, postgres, sqlite",
|
||||
"version": "0.1.24-pre",
|
||||
"version": "0.1.24-pre2",
|
||||
"author": "Anatoliy Chakkaev <rpm1602@gmail.com>",
|
||||
"contributors": [
|
||||
{ "name": "Anatoliy Chakkaev", "email": "rpm1602@gmail.com" },
|
||||
|
|
Loading…
Reference in New Issue