Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for AfterAppend (0.07 sec)

  1. tests/associations_has_one_test.go

    	}
    
    	if account.ID == 0 {
    		t.Fatalf("Account's ID should be created")
    	}
    
    	user.Account = account
    	CheckUser(t, user2, user)
    
    	AssertAssociationCount(t, user, "Account", 1, "AfterAppend")
    
    	// Replace
    	account2 := Account{Number: "account-has-one-replace"}
    
    	if err := DB.Model(&user2).Association("Account").Replace(&account2); err != nil {
    		t.Fatalf("Error happened when append Account, got %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)
  2. tests/associations_has_many_test.go

    	}
    
    	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")
    
    	pets2 := []Pet{{Name: "pet-has-many-append-1-1"}, {Name: "pet-has-many-append-1-1"}}
    
    	if err := DB.Model(&user2).Association("Pets").Append(&pets2); err != nil {
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Wed Jun 12 10:49:45 UTC 2024
    - 16K bytes
    - Viewed (0)
Back to top