Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 1,182 for happened (0.13 sec)

  1. tests/associations_has_many_test.go

    	}
    
    	// Append
    	DB.Model(&users).Association("Pets").Append(
    		&Pet{Name: "pet-slice-append-1"},
    		[]*Pet{{Name: "pet-slice-append-2-1"}, {Name: "pet-slice-append-2-2"}},
    		&Pet{Name: "pet-slice-append-3"},
    	)
    
    	AssertAssociationCount(t, users, "Pets", 10, "After Append")
    
    	// Replace -> same as append
    	DB.Model(&users).Association("Pets").Replace(
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Wed Jun 12 10:49:45 UTC 2024
    - 16K bytes
    - Viewed (0)
  2. tests/associations_has_one_test.go

    	}
    
    	// Append
    	DB.Model(&users).Association("Account").Append(
    		&Account{Number: "account-slice-append-1"},
    		&Account{Number: "account-slice-append-2"},
    		&Account{Number: "account-slice-append-3"},
    	)
    
    	AssertAssociationCount(t, users, "Account", 3, "After Append")
    
    	// Replace -> same as append
    
    	// Delete
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Wed Jun 12 10:49:45 UTC 2024
    - 7.1K bytes
    - Viewed (0)
  3. tests/gorm_test.go

    			t.Fatalf("errors happened on create: %v", results.Error)
    		} else if results.RowsAffected != 1 {
    			t.Fatalf("rows affected expects: %v, got %v", 1, results.RowsAffected)
    		} else if u1.ID == 0 {
    			t.Fatalf("ID expects : not equal 0, got %v", u1.ID)
    		}
    
    		got := user{}
    		results := DB.First(&got, "id = ?", u1.ID)
    		if results.Error != nil {
    			t.Fatalf("errors happened on first: %v", results.Error)
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Thu Jun 01 07:22:21 UTC 2023
    - 3.3K bytes
    - Viewed (0)
  4. tests/update_belongs_to_test.go

    	if err := DB.Create(&user).Error; err != nil {
    		t.Fatalf("errors happened when create: %v", err)
    	}
    
    	user.Company = Company{Name: "company-belongs-to-association"}
    	user.Manager = &User{Name: "manager-belongs-to-association"}
    	if err := DB.Save(&user).Error; err != nil {
    		t.Fatalf("errors happened when update: %v", err)
    	}
    
    	var user2 User
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Thu Jul 14 06:55:54 UTC 2022
    - 1.6K bytes
    - Viewed (0)
  5. tests/associations_belongs_to_test.go

    	if err := DB.Model(&user2).Association("Company").Append(&company); err != nil {
    		t.Fatalf("Error happened when append Company, got %v", err)
    	}
    
    	if err := DB.Model(&user2).Association("Manager").Append(manager); err != nil {
    		t.Fatalf("Error happened when append Manager, got %v", err)
    	}
    
    	AssertAssociationCount(t, user2, "Company", 1, "after prepare data")
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Mon Oct 30 09:15:49 UTC 2023
    - 9.3K bytes
    - Viewed (0)
  6. tests/update_has_many_test.go

    	user := *GetUser("update-has-many", Config{})
    
    	if err := DB.Create(&user).Error; err != nil {
    		t.Fatalf("errors happened when create: %v", err)
    	}
    
    	user.Pets = []*Pet{{Name: "pet1"}, {Name: "pet2"}}
    	if err := DB.Save(&user).Error; err != nil {
    		t.Fatalf("errors happened when update: %v", err)
    	}
    
    	var user2 User
    	DB.Preload("Pets").Find(&user2, "id = ?", user.ID)
    	CheckUser(t, user2, user)
    
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Thu Jan 06 07:02:53 UTC 2022
    - 2K bytes
    - Viewed (0)
  7. tests/associations_many2many_test.go

    	DB.Create(&language)
    
    	if err := DB.Model(&user2).Association("Languages").Append(&language); err != nil {
    		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"},
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Sat Jun 10 13:05:19 UTC 2023
    - 13.2K bytes
    - Viewed (0)
  8. tests/create_test.go

    	}
    
    	if results := DB.Create(&users); results.Error != nil {
    		t.Fatalf("errors happened when create: %v", results.Error)
    	} else if results.RowsAffected != int64(len(users)) {
    		t.Fatalf("rows affected expects: %v, got %v", len(users), results.RowsAffected)
    	}
    
    	var userIDs []uint
    	for _, user := range users {
    		userIDs = append(userIDs, user.ID)
    		CheckUser(t, user, user)
    	}
    
    	var users2 []User
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Tue Mar 19 03:50:28 UTC 2024
    - 26.4K bytes
    - Viewed (0)
  9. tests/update_has_one_test.go

    	user := *GetUser("update-has-one", Config{})
    
    	if err := DB.Create(&user).Error; err != nil {
    		t.Fatalf("errors happened when create: %v", err)
    	}
    
    	user.Account = Account{Number: "account-has-one-association"}
    
    	if err := DB.Save(&user).Error; err != nil {
    		t.Fatalf("errors happened when update: %v", err)
    	}
    
    	var user2 User
    	DB.Preload("Account").Find(&user2, "id = ?", user.ID)
    	CheckUser(t, user2, user)
    
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Thu Jul 14 06:55:54 UTC 2022
    - 3.6K bytes
    - Viewed (0)
  10. tests/update_many2many_test.go

    		t.Fatalf("errors happened when create: %v", err)
    	}
    
    	user.Languages = []Language{{Code: "zh-CN", Name: "Chinese"}, {Code: "en", Name: "English"}}
    	for _, lang := range user.Languages {
    		DB.Create(&lang)
    	}
    	user.Friends = []*User{{Name: "friend-1"}, {Name: "friend-2"}}
    
    	if err := DB.Save(&user).Error; err != nil {
    		t.Fatalf("errors happened when update: %v", err)
    	}
    
    	var user2 User
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Thu Jan 06 07:02:53 UTC 2022
    - 1.3K bytes
    - Viewed (0)
Back to top