Search Options

Results per page
Sort
Preferred Languages
Advance

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

  1. tests/associations_has_many_test.go

    	AssertAssociationCount(t, user, "Pets", 2, "")
    
    	// Append
    	pet := Pet{Name: "pet-has-many-append"}
    
    	if err := DB.Model(&user2).Association("Pets").Append(&pet); err != nil {
    		t.Fatalf("Error happened when append account, got %v", err)
    	}
    
    	if pet.ID == 0 {
    		t.Fatalf("Pet's ID should be created")
    	}
    
    	user.Pets = append(user.Pets, &pet)
    	CheckUser(t, user2, user)
    
    	AssertAssociationCount(t, user, "Pets", 3, "AfterAppend")
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Dec 15 08:36:08 GMT 2023
    - 15.6K bytes
    - Viewed (0)
Back to top