Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 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_belongs_to_test.go

    	user.Company = company
    	user.Manager = manager
    	user.CompanyID = &company.ID
    	user.ManagerID = &manager.ID
    	CheckUser(t, user2, user)
    
    	AssertAssociationCount(t, user2, "Company", 1, "AfterAppend")
    	AssertAssociationCount(t, user2, "Manager", 1, "AfterAppend")
    
    	// Replace
    	company2 := Company{Name: "company-belongs-to-replace"}
    	manager2 := GetUser("manager-belongs-to-replace", Config{})
    
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Mon Oct 30 09:15:49 UTC 2023
    - 9.3K bytes
    - Viewed (0)
  3. 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)
  4. tests/associations_many2many_test.go

    		t.Fatalf("Error happened when append account, got %v", err)
    	}
    
    	user.Languages = append(user.Languages, language)
    	CheckUser(t, user2, user)
    
    	AssertAssociationCount(t, user, "Languages", 3, "AfterAppend")
    
    	languages := []Language{
    		{Code: "language-many2many-append-1-1", Name: "language-many2many-append-1-1"},
    		{Code: "language-many2many-append-2-1", Name: "language-many2many-append-2-1"},
    	}
    	DB.Create(&languages)
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Sat Jun 10 13:05:19 UTC 2023
    - 13.2K bytes
    - Viewed (0)
Back to top