Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for nested_preload (0.1 sec)

  1. tests/preload_test.go

    		Languages: 3,
    		Friends:   1,
    	})
    
    	DB.Preload(clause.Associations).Find(&user3, "id = ?", user.ID)
    	CheckUser(t, user3, user)
    }
    
    func TestNestedPreload(t *testing.T) {
    	user := *GetUser("nested_preload", Config{Pets: 2})
    
    	for idx, pet := range user.Pets {
    		pet.Toy = Toy{Name: "toy_nested_preload_" + strconv.Itoa(idx+1)}
    	}
    
    	if err := DB.Create(&user).Error; err != nil {
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Wed Jun 12 10:00:47 UTC 2024
    - 15.9K bytes
    - Viewed (0)
Back to top