diff --git a/lib/abstract-class.js b/lib/abstract-class.js index f40f794f..960b4e73 100644 --- a/lib/abstract-class.js +++ b/lib/abstract-class.js @@ -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 diff --git a/lib/schema.js b/lib/schema.js index 03542ef1..78ded775 100644 --- a/lib/schema.js +++ b/lib/schema.js @@ -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; diff --git a/package.json b/package.json index eeb1be08..56c90d9e 100644 --- a/package.json +++ b/package.json @@ -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 ", "contributors": [ { "name": "Anatoliy Chakkaev", "email": "rpm1602@gmail.com" },