Remove unused cached relations, closes #134

This commit is contained in:
Anatoliy Chakkaev 2012-10-22 00:14:05 +04:00
parent 4fe9759afc
commit c8f6d416a6
2 changed files with 1 additions and 9 deletions

View File

@ -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];

View File

@ -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();
}
};