Skip to content

Commit

Permalink
fixes waterline/issues/1427
Browse files Browse the repository at this point in the history
  • Loading branch information
jojo897 authored and Jordan SABBAH committed Jan 5, 2017
1 parent a997eb5 commit 7eee177
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/waterline-schema/joinTables.js
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ JoinTables.prototype.markCustomJoinTables = function(collection) {
var throughPath = collection + '.' + attribute;
var linkedAttrs = this.collections[linkedCollection].attributes;
this.collections[linkedCollection].throughTable[throughPath] = _.find(_.keys(linkedAttrs), function(attr){
return linkedAttrs[attr].references === attributes[attribute].collection.toLowerCase();
return linkedAttrs[attr].references === attributes[attribute].collection.toLowerCase() && attributes[attribute].via !== attr;
});

// Build up proper reference on the attribute
Expand Down

0 comments on commit 7eee177

Please sign in to comment.