fix: check if it ends with _cmps

This commit is contained in:
Bassel Kanso 2024-05-29 15:04:32 +03:00
parent 5985207d3b
commit 6ecc67b1e9

View File

@ -337,18 +337,7 @@ const filterValidRelationalAttributes = (attributes: Record<string, any>) => {
return attribute.owner || (!attribute.mappedBy && !attribute.morphBy);
};
const isComponentLike = (attribute: any) => {
return (
/**
* probably can remove attribute.component & attribute.components
* to be checked
* */
attribute.component ||
attribute.components ||
attribute.joinTable?.name.includes('components') ||
attribute.joinTable?.name.includes('cmps')
);
};
const isComponentLike = (attribute: any) => attribute.joinTable?.name.endsWith('_cmps');
return Object.entries(attributes)
.filter(([, attribute]) => {