diff --git a/lib/relation-definition.js b/lib/relation-definition.js index a6a3f0a7..3c22e651 100644 --- a/lib/relation-definition.js +++ b/lib/relation-definition.js @@ -572,7 +572,7 @@ RelationDefinition.hasMany = function hasMany(modelFrom, modelTo, params) { definition.modelThrough = params.through; - var keyThrough = definition.throughKey || i8n.camelize(modelTo.modelName + '_id', true); + var keyThrough = params.keyThrough || i8n.camelize(modelTo.modelName + '_id', true); definition.keyThrough = keyThrough; modelFrom.relations[relationName] = definition;