cleaned some old comments

This commit is contained in:
Sébastien Drouyer 2012-12-16 19:19:53 +01:00
parent 708265df22
commit 6db1a003d4
1 changed files with 0 additions and 66 deletions

View File

@ -424,14 +424,6 @@ AbstractClass.include = function (objects, include, callback) {
}
}
/*
async.parallel(callbacks, function(err, results) {
callback(null, objs);
});
*/
function processIncludeJoin(ij) {
if (typeof ij === 'string') {
ij = [ij];
@ -525,64 +517,6 @@ AbstractClass.include = function (objects, include, callback) {
return null;
}
/*
function processIncludeItem(model, objs, include, keyVals, objsByKeys) {
var relations = model.relations;
if (include.constructor.name === 'Object') {
var relationName = Object.keys(include)[0];
var relation = relations[relationName];
var subInclude = include[relationName];
} else {
var relationName = include;
var relation = relations[relationName];
var subInclude = [];
}
var req = {'where': {}};
if (!keyVals[relation.keyFrom]) {
objsByKeys[relation.keyFrom] = {};
for (var j = 0; j < objs.length; j++) {
if (!objsByKeys[relation.keyFrom][objs[j][relation.keyFrom]]) {
objsByKeys[relation.keyFrom][objs[j][relation.keyFrom]] = [];
}
objsByKeys[relation.keyFrom][objs[j][relation.keyFrom]].push(objs[j]);
}
keyVals[relation.keyFrom] = Object.keys(objsByKeys[relation.keyFrom]);
}
req['where'][relation.keyTo] = {inq: keyVals[relation.keyFrom]};
req['include'] = subInclude;
return function(cb) {
relation.model.all(req, function(err, dataIncluded) {
var objsIncluded = dataIncluded.map(function (obj) {
return self.fromDatabase(relation.model.modelName, obj);
});
for (var i = 0; i < objsIncluded.length; i++) {
var objectsFrom = objsByKeys[relation.keyFrom][objsIncluded[i][relation.keyTo]];
for (var j = 0; j < objectsFrom.length; j++) {
if (!objectsFrom[j].__cache) {
objectsFrom[j].__cache = {};
}
if (relation.type == 'hasMany') {
if (!objectsFrom[j].__cache[relationName]) {
objectsFrom[j].__cache[relationName] = [];
}
objectsFrom[j].__cache[relationName].push(objsIncluded[i]);
} else {
objectsFrom[j].__cache[relationName] = objsIncluded[i];
}
}
}
cb(err, dataIncluded);
});
};
}
*/
}
/**