Skip to content

Commit

Permalink
Update associations.md
Browse files Browse the repository at this point in the history
  • Loading branch information
qqxhb authored Oct 25, 2023
1 parent f4c2768 commit 2e4263c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pages/gen/associations.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ card := g.GenerateModel("credit_cards")
customer := g.GenerateModel("customers", gen.FieldRelate(field.HasMany, "CreditCards", card,
&field.RelateConfig{
// RelateSlice: true,
GORMTag: "foreignKey:CustomerRefer",
GORMTag: field.GormTag{"foreignKey": []string{"CustomerRefer"}},
}),
)

Expand Down Expand Up @@ -101,7 +101,7 @@ If associated model already exists, `gen.FieldRelateModel` can help you build as
customer := g.GenerateModel("customers", gen.FieldRelateModel(field.HasMany, "CreditCards", model.CreditCard{},
&field.RelateConfig{
// RelateSlice: true,
GORMTag: "foreignKey:CustomerRefer",
GORMTag: field.GormTag{"foreignKey": []string{"CustomerRefer"}},
}),
)

Expand Down

0 comments on commit 2e4263c

Please sign in to comment.