Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestEmbeddedRelations (0.28 sec)

  1. tests/embedded_struct_test.go

    	}
    
    	hnPost := HNPost{Content: Content{Content: "hello world"}}
    
    	if err := DB.Create(&hnPost).Error; err != nil {
    		t.Errorf("Failed to create got error %v", err)
    	}
    }
    
    func TestEmbeddedRelations(t *testing.T) {
    	type EmbUser struct {
    		gorm.Model
    		Name      string
    		Age       uint
    		Languages []Language `gorm:"many2many:EmbUserSpeak;"`
    	}
    
    	type AdvancedUser struct {
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Wed May 08 04:07:58 UTC 2024
    - 7.3K bytes
    - Viewed (0)
Back to top