Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for checkout (0.15 sec)

  1. tests/associations_has_one_test.go

    	if err := DB.Create(&pet).Error; err != nil {
    		t.Fatalf("errors happened when create: %v", err)
    	}
    
    	CheckPet(t, pet, pet)
    
    	// Find
    	var pet2 Pet
    	DB.Find(&pet2, "id = ?", pet.ID)
    	DB.Model(&pet2).Association("Toy").Find(&pet2.Toy)
    	CheckPet(t, pet2, pet)
    
    	// Count
    	AssertAssociationCount(t, pet, "Toy", 1, "")
    
    	// Append
    	toy := Toy{Name: "toy-has-one-append"}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Jan 06 07:02:53 GMT 2022
    - 6.8K bytes
    - Viewed (0)
Back to top