mirror of
https://github.com/strapi/strapi.git
synced 2025-08-08 00:37:38 +00:00
16 lines
325 B
JavaScript
16 lines
325 B
JavaScript
'use strict';
|
|
|
|
const findModelByAssoc = ({ assoc }) => {
|
|
const target = assoc.collection || assoc.model;
|
|
return strapi.db.getModel(target, assoc.plugin);
|
|
};
|
|
|
|
const isPolymorphic = ({ assoc }) => {
|
|
return assoc.nature.toLowerCase().indexOf('morph') !== -1;
|
|
};
|
|
|
|
module.exports = {
|
|
findModelByAssoc,
|
|
isPolymorphic,
|
|
};
|