From c8f6d416a675d129fed9ae5f1be4afa989aa8658 Mon Sep 17 00:00:00 2001 From: Anatoliy Chakkaev Date: Mon, 22 Oct 2012 00:14:05 +0400 Subject: [PATCH] Remove unused cached relations, closes #134 --- lib/abstract-class.js | 8 -------- lib/schema.js | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/lib/abstract-class.js b/lib/abstract-class.js index da71b5ab..f40f794f 100644 --- a/lib/abstract-class.js +++ b/lib/abstract-class.js @@ -37,13 +37,6 @@ AbstractClass.prototype._initProperties = function (data, applySetters) { var properties = ds.properties; data = data || {}; - Object.defineProperty(this, 'cachedRelations', { - writable: true, - enumerable: false, - configurable: true, - value: {} - }); - Object.defineProperty(this, '__data', { writable: true, enumerable: false, @@ -735,7 +728,6 @@ AbstractClass.belongsTo = function (anotherClass, params) { this.prototype[methodName] = function (p) { if (p instanceof AbstractClass) { // acts as setter this[fk] = p.id; - this.cachedRelations[methodName] = p; } else if (typeof p === 'function') { // acts as async getter this.__finders__[methodName](this[fk], p); return this[fk]; diff --git a/lib/schema.js b/lib/schema.js index c72e6a02..03542ef1 100644 --- a/lib/schema.js +++ b/lib/schema.js @@ -353,7 +353,7 @@ Schema.prototype.defineForeignKey = function defineForeignKey(className, key) { */ Schema.prototype.disconnect = function disconnect() { if (typeof this.adapter.disconnect === 'function') { - this.connected = true; + this.connected = false; this.adapter.disconnect(); } };