Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestPolymorphicHasOneAssociation (0.12 sec)

  1. tests/associations_has_one_test.go

    	AssertAssociationCount(t, users, "Account", 2, "after delete")
    
    	// Clear
    	DB.Model(&users).Association("Account").Clear()
    	AssertAssociationCount(t, users, "Account", 0, "After Clear")
    }
    
    func TestPolymorphicHasOneAssociation(t *testing.T) {
    	pet := Pet{Name: "hasone", Toy: Toy{Name: "toy-has-one"}}
    
    	if err := DB.Create(&pet).Error; err != nil {
    		t.Fatalf("errors happened when create: %v", err)
    	}
    
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Wed Jun 12 10:49:45 UTC 2024
    - 7.1K bytes
    - Viewed (0)
Back to top