Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip implementing Related if the same related entity is being referenced by a conjunct relation #1298

Merged
merged 1 commit into from
Dec 17, 2022

Conversation

billy1624
Copy link
Member

@billy1624 billy1624 commented Dec 12, 2022

PR Info

Bug Fixes

The original bug description: #1287 (comment)

  • Skip implementing the direct Related if a many-to-many with intermediate entity exists.
// Skip implementation of ths
impl Related<super::baker::Entity> for Entity {
    fn to() -> RelationDef {
        Relation::Baker.def()
    }
}

// Keep this
impl Related<super::baker::Entity> for Entity {
    fn to() -> RelationDef {
        super::cakes_bakers::Relation::Baker.def()
    }
    fn via() -> Option<RelationDef> {
        Some(super::cakes_bakers::Relation::Cake.def().rev())
    }
}

@billy1624 billy1624 self-assigned this Dec 12, 2022
@billy1624 billy1624 marked this pull request as ready for review December 12, 2022 10:44
@billy1624 billy1624 requested a review from tyt2y3 December 12, 2022 10:44
@billy1624 billy1624 merged commit 8982d88 into master Dec 17, 2022
@billy1624 billy1624 deleted the fix-duplicated-related-impl branch December 17, 2022 04:52
billy1624 added a commit that referenced this pull request Dec 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

> 0.10.2: error[E0119]: conflicting implementations of trait
1 participant