Skip to content

Commit

Permalink
Merge pull request #23942 from mshima/skip_ci-eager
Browse files Browse the repository at this point in the history
don't override relationshipEagerLoad
  • Loading branch information
DanielFran authored Oct 22, 2023
2 parents 3611803 + be7f5db commit 9a22239
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions generators/base-application/support/prepare-entity.mts
Original file line number Diff line number Diff line change
Expand Up @@ -630,11 +630,12 @@ function preparePostEntityCommonDerivedPropertiesNotTyped(entity: any) {

mutateData(relationship, {
bagRelationship: relationship.ownerSide && relationship.collection,
relationshipEagerLoad: () =>
relationship.bagRelationship ||
entity.eagerLoad ||
// Fetch relationships if otherEntityField differs otherwise the id is enough
(relationship.ownerSide && relationship.otherEntity.primaryKey.name !== relationship.otherEntityField),
relationshipEagerLoad: ({ relationshipEagerLoad, bagRelationship, ownerSide, otherEntity, otherEntityField }) =>
relationshipEagerLoad ??
(bagRelationship ||
entity.eagerLoad ||
// Fetch relationships if otherEntityField differs otherwise the id is enough
(ownerSide && otherEntity.primaryKey.name !== otherEntityField)),
});
});
entity.relationshipsContainEagerLoad = entity.relationships.some(relationship => relationship.relationshipEagerLoad);
Expand Down

0 comments on commit 9a22239

Please sign in to comment.