Remove unused cached relations, closes #134
This commit is contained in:
parent
4fe9759afc
commit
c8f6d416a6
|
@ -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];
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue