Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 2 of 2 for TestPolymorphicHasOneAssociationForSlice (0.31 seconds)

  1. tests/associations_has_one_test.go

    	if err := DB.Model(&pet2).Association("Toy").Clear(); err != nil {
    		t.Errorf("Error happened when clear Toy, got %v", err)
    	}
    
    	AssertAssociationCount(t, pet2, "Toy", 0, "after clear")
    }
    
    func TestPolymorphicHasOneAssociationForSlice(t *testing.T) {
    	pets := []Pet{
    		{Name: "hasone-1", Toy: Toy{Name: "toy-has-one"}},
    		{Name: "hasone-2", Toy: Toy{}},
    		{Name: "hasone-3", Toy: Toy{Name: "toy-has-one"}},
    	}
    
    	DB.Create(&pets)
    Created: Sun Apr 05 09:35:12 GMT 2026
    - Last Modified: Wed Jun 12 10:49:45 GMT 2024
    - 7.1K bytes
    - Click Count (0)
  2. tests/create_test.go

    Jinzhu <******@****.***> 1753091707 +0800
    Created: Sun Apr 05 09:35:12 GMT 2026
    - Last Modified: Mon Jul 21 09:55:20 GMT 2025
    - 26.8K bytes
    - Click Count (0)
Back to Top