Remove unused data
This commit is contained in:
parent
7ad22939ab
commit
5221d12305
|
@ -720,7 +720,6 @@ HasManyThrough.prototype.exists = function (acInst, done) {
|
||||||
var modelThrough = definition.modelThrough;
|
var modelThrough = definition.modelThrough;
|
||||||
var pk1 = definition.keyFrom;
|
var pk1 = definition.keyFrom;
|
||||||
|
|
||||||
var data = {};
|
|
||||||
var query = {};
|
var query = {};
|
||||||
|
|
||||||
var fk1 = findBelongsTo(modelThrough, definition.modelFrom,
|
var fk1 = findBelongsTo(modelThrough, definition.modelFrom,
|
||||||
|
@ -732,12 +731,8 @@ HasManyThrough.prototype.exists = function (acInst, done) {
|
||||||
var fk2 = findBelongsTo(modelThrough, definition.modelTo, pk2);
|
var fk2 = findBelongsTo(modelThrough, definition.modelTo, pk2);
|
||||||
|
|
||||||
query[fk1] = this.modelInstance[pk1];
|
query[fk1] = this.modelInstance[pk1];
|
||||||
|
|
||||||
query[fk2] = (acInst instanceof definition.modelTo) ? acInst[pk2] : acInst;
|
query[fk2] = (acInst instanceof definition.modelTo) ? acInst[pk2] : acInst;
|
||||||
|
|
||||||
data[fk1] = this.modelInstance[pk1];
|
|
||||||
data[fk2] = (acInst instanceof definition.modelTo) ? acInst[pk2] : acInst;
|
|
||||||
|
|
||||||
modelThrough.count(query, function(err, ac) {
|
modelThrough.count(query, function(err, ac) {
|
||||||
done(err, ac > 0);
|
done(err, ac > 0);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue