Merge pull request #5607 from strapi/fix/#5190/badSingularFormOfColumnNameInQuery

Fix bad singular form of column name
This commit is contained in:
Alexandre BODIN 2020-03-26 11:47:37 +01:00 committed by GitHub
commit 8aafa1b53a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -53,7 +53,7 @@ const createComponentModels = async ({ model, definition, ORM, GLOBALS }) => {
componentAttributes.forEach(name => {
model[name] = function relation() {
return this.hasMany(joinModel).query(qb => {
return this.hasMany(joinModel, joinColumn).query(qb => {
qb.where('field', name)
.whereIn(
'component_type',