- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 30 for toys (0.02 sec)
-
tests/update_has_many_test.go
t.Fatalf("errors happened when create: %v", err) } user.Toys = []Toy{{Name: "toy1"}, {Name: "toy2"}} if err := DB.Save(&user).Error; err != nil { t.Fatalf("errors happened when update: %v", err) } var user2 User DB.Preload("Toys").Find(&user2, "id = ?", user.ID) CheckUser(t, user2, user) for idx := range user.Toys { user.Toys[idx].Name += "new" } if err := DB.Save(&user).Error; err != nil {
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Thu Jan 06 07:02:53 UTC 2022 - 2K bytes - Viewed (0) -
tests/helper_test.go
} } }) t.Run("Toys", func(t *testing.T) { if len(user.Toys) != len(expect.Toys) { t.Fatalf("toys should equal, expect: %v, got %v", len(expect.Toys), len(user.Toys)) } sort.Slice(user.Toys, func(i, j int) bool { return user.Toys[i].ID > user.Toys[j].ID }) sort.Slice(expect.Toys, func(i, j int) bool { return expect.Toys[i].ID > expect.Toys[j].ID })
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Tue Mar 19 03:50:28 UTC 2024 - 8K bytes - Viewed (0) -
tests/associations_has_one_test.go
{Name: "hasone-2", Toy: Toy{}}, {Name: "hasone-3", Toy: Toy{Name: "toy-has-one"}}, } DB.Create(&pets) // Count AssertAssociationCount(t, pets, "Toy", 2, "") // Find var toys []Toy if DB.Model(&pets).Association("Toy").Find(&toys); len(toys) != 2 { t.Errorf("toys count should be %v, but got %v", 3, len(toys)) } // Append
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Wed Jun 12 10:49:45 UTC 2024 - 7.1K bytes - Viewed (0) -
tests/named_polymorphic_test.go
t.Errorf("Hamster's preferred toy failed to preload") } if hamster2.OtherToy.ID != hamster.OtherToy.ID || hamster2.OtherToy.Name != hamster.OtherToy.Name { t.Errorf("Hamster's other toy failed to preload") } // clear to omit Toy.ID in count hamster2.PreferredToy = Toy{} hamster2.OtherToy = Toy{} if DB.Model(&hamster2).Association("PreferredToy").Count() != 1 {
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Wed Jul 08 09:59:40 UTC 2020 - 4.2K bytes - Viewed (0) -
tests/delete_test.go
*GetUser("delete_slice_with_associations1", Config{Account: true, Pets: 4, Toys: 1, Company: true, Manager: true, Team: 1, Languages: 1, Friends: 4}), *GetUser("delete_slice_with_associations2", Config{Account: true, Pets: 3, Toys: 2, Company: true, Manager: true, Team: 2, Languages: 2, Friends: 3}), *GetUser("delete_slice_with_associations3", Config{Account: true, Pets: 2, Toys: 3, Company: true, Manager: true, Team: 3, Languages: 3, Friends: 2}),
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Mon Jul 21 02:46:58 UTC 2025 - 9.5K bytes - Viewed (0) -
utils/tests/models.go
Active bool } type Account struct { gorm.Model UserID sql.NullInt64 Number string } type Pet struct { gorm.Model UserID *uint Name string Toy Toy `gorm:"polymorphic:Owner;"` } type Toy struct { gorm.Model Name string OwnerID string OwnerType string } type Tools struct { gorm.Model Name string CustomID string Type string }
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Fri Dec 15 08:36:08 UTC 2023 - 2.1K bytes - Viewed (0) -
tests/count_test.go
Preload("Toys", func(db *gorm.DB) *gorm.DB { return db.Table("toys").Select("name") }).Count(&count12).Error; err == nil { t.Errorf("error should raise when using preload without schema") } var count13 int64 if err := DB.Model(User{}). Where("name in ?", []string{user1.Name, user2.Name, user3.Name}). Preload("Toys", func(db *gorm.DB) *gorm.DB {
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Mon Oct 30 09:15:49 UTC 2023 - 6.9K bytes - Viewed (0) -
schema/model_test.go
"gorm.io/gorm" "gorm.io/gorm/utils/tests" ) type User struct { *gorm.Model Name *string Age *uint Birthday *time.Time Account *tests.Account Pets []*tests.Pet Toys []*tests.Toy `gorm:"polymorphic:Owner"` CompanyID *int Company *tests.Company ManagerID *uint Manager *User Team []*User `gorm:"foreignkey:ManagerID"`
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Thu Jan 06 07:02:53 UTC 2022 - 1.1K bytes - Viewed (0) -
src/main/resources/fess_indices/fess/ca/stopwords.txt
solament sols son són sons sota sou t'ha t'han t'he ta tal també tampoc tan tant tanta tantes teu teus teva teves ton tons tot tota totes tots un una unes uns us va vaig vam van vas veu vosaltres vostra vostre
Registered: Thu Sep 04 12:52:25 UTC 2025 - Last Modified: Thu Jul 19 06:31:02 UTC 2018 - 1.3K bytes - Viewed (0) -
cmd/metrics-v3-replication.go
m.Set(replicationMaxActiveWorkers, float64(qa.Max)) if len(qs.XferStats) > 0 { tots := qs.XferStats[Total] m.Set(replicationAverageDataTransferRate, tots.Avg) m.Set(replicationCurrentDataTransferRate, tots.Curr) m.Set(replicationMaxDataTransferRate, tots.Peak) } m.Set(replicationRecentBacklogCount, float64(qs.MRFStats.LastFailedCount)) return nil
Registered: Sun Sep 07 19:28:11 UTC 2025 - Last Modified: Thu Aug 15 12:04:40 UTC 2024 - 4.6K bytes - Viewed (0)