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

FieldRelate #245

Closed
AyWa opened this issue Nov 24, 2021 · 2 comments
Closed

FieldRelate #245

AyWa opened this issue Nov 24, 2021 · 2 comments
Assignees

Comments

@AyWa
Copy link

AyWa commented Nov 24, 2021

Description

gen.FieldRelate use check.BaseStruct which is in an internal package.
So end users will get use of internal package gorm.io/gen/internal/check not allowed

@tr1v3r
Copy link
Member

tr1v3r commented Nov 24, 2021

yeah, this is expected behavior. u can get *check.BaseStruct from method GenerateModel

    b := g.GenerateModel("banks")
    cc := g.GenerateModel("credit_cards", gen.FieldRelate(field.BelongsTo, "Bank", b, nil))

@AyWa
Copy link
Author

AyWa commented Nov 24, 2021

Hum I see. thank you for quick answer. Sorry about it !

@AyWa AyWa closed this as completed Nov 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants