mirror of
https://github.com/strapi/strapi.git
synced 2025-11-08 14:19:40 +00:00
use the new method to generate the collection name
This commit is contained in:
parent
3593046c41
commit
e5ce8c1b42
@ -502,7 +502,7 @@ module.exports = function(strapi) {
|
|||||||
console.log(e);
|
console.log(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
strapi.log.warn(`The SQL database indexes haven't been generated successfully. Please enable the debug mode for more details.`);
|
strapi.log.warn('The SQL database indexes haven\'t been generated successfully. Please enable the debug mode for more details.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -677,24 +677,11 @@ module.exports = function(strapi) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const table = _.get(manyRelations, 'collectionName') ||
|
const table = _.get(manyRelations, 'collectionName')
|
||||||
_.map(
|
|| utilsModels.getCollectionName(
|
||||||
_.sortBy(
|
collection.attributes[manyRelations.via],
|
||||||
[
|
|
||||||
collection.attributes[
|
|
||||||
manyRelations.via
|
|
||||||
],
|
|
||||||
manyRelations
|
manyRelations
|
||||||
],
|
|
||||||
'collection'
|
|
||||||
),
|
|
||||||
table => {
|
|
||||||
return _.snakeCase(
|
|
||||||
// eslint-disable-next-line prefer-template
|
|
||||||
pluralize.plural(table.collection) + ' ' + pluralize.plural(table.via)
|
|
||||||
);
|
);
|
||||||
}
|
|
||||||
).join('__');
|
|
||||||
|
|
||||||
await handler(table, attributes);
|
await handler(table, attributes);
|
||||||
}
|
}
|
||||||
@ -813,24 +800,11 @@ module.exports = function(strapi) {
|
|||||||
strapi.plugins[details.plugin].models[details.collection]:
|
strapi.plugins[details.plugin].models[details.collection]:
|
||||||
strapi.models[details.collection];
|
strapi.models[details.collection];
|
||||||
|
|
||||||
const collectionName = _.get(details, 'collectionName') ||
|
const collectionName = _.get(details, 'collectionName')
|
||||||
_.map(
|
|| utilsModels.getCollectionName(
|
||||||
_.sortBy(
|
collection.attributes[details.via],
|
||||||
[
|
details,
|
||||||
collection.attributes[
|
|
||||||
details.via
|
|
||||||
],
|
|
||||||
details
|
|
||||||
],
|
|
||||||
'collection'
|
|
||||||
),
|
|
||||||
table => {
|
|
||||||
return _.snakeCase(
|
|
||||||
// eslint-disable-next-line prefer-template
|
|
||||||
pluralize.plural(table.collection) + ' ' + pluralize.plural(table.via)
|
|
||||||
);
|
);
|
||||||
}
|
|
||||||
).join('__');
|
|
||||||
|
|
||||||
const relationship = _.clone(
|
const relationship = _.clone(
|
||||||
collection.attributes[details.via]
|
collection.attributes[details.via]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user