Skip to content

Commit 5adc0ce

Browse files
authoredOct 26, 2023
test: fix TestEmbeddedRelations (go-gorm#6639)
1 parent 78e9059 commit 5adc0ce

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed
 

‎tests/embedded_struct_test.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,15 @@ func TestEmbeddedScanValuer(t *testing.T) {
236236
}
237237

238238
func TestEmbeddedRelations(t *testing.T) {
239+
type EmbUser struct {
240+
gorm.Model
241+
Name string
242+
Age uint
243+
Languages []Language `gorm:"many2many:EmbUserSpeak;"`
244+
}
245+
239246
type AdvancedUser struct {
240-
User `gorm:"embedded"`
247+
EmbUser `gorm:"embedded"`
241248
Advanced bool
242249
}
243250

0 commit comments

Comments
 (0)
Please sign in to comment.