- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 11 for team (0.17 sec)
-
tests/associations_has_many_test.go
if err := DB.Model(&user2).Association("Team").Append(&teams); err != nil { t.Fatalf("Error happened when append team, got %v", err) } for _, team := range teams { team := team if team.ID == 0 { t.Fatalf("Team's ID should be created") } user.Team = append(user.Team, team) } CheckUser(t, user2, user)
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Fri Dec 15 08:36:08 GMT 2023 - 15.6K bytes - Viewed (0) -
tests/create_test.go
*GetUser("bulk_5", Config{Account: false, Pets: 0, Toys: 3, Company: true, Manager: false, Team: 1, Languages: 3, Friends: 1}), *GetUser("bulk_6", Config{Account: true, Pets: 4, Toys: 3, Company: false, Manager: true, Team: 1, Languages: 3, Friends: 0}), *GetUser("bulk_7", Config{Account: true, Pets: 1, Toys: 3, Company: true, Manager: true, Team: 4, Languages: 3, Friends: 1}),
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Tue Mar 19 03:50:28 GMT 2024 - 26.4K bytes - Viewed (0) -
utils/tests/models.go
"time" "gorm.io/gorm" ) // User has one `Account` (has one), many `Pets` (has many) and `Toys` (has many - polymorphic) // He works in a Company (belongs to), he has a Manager (belongs to - single-table), and also managed a Team (has many - single-table) // He speaks many languages (many to many) and has many friends (many to many - single-table) // His pet also has one Toy (has one - polymorphic) // NamedPet is a reference to a named `Pet` (has one)
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Fri Dec 15 08:36:08 GMT 2023 - 2.1K bytes - Viewed (0) -
tests/helper_test.go
} }) t.Run("Team", func(t *testing.T) { if len(user.Team) != len(expect.Team) { t.Fatalf("Team should equal, expect: %v, got %v", len(expect.Team), len(user.Team)) } sort.Slice(user.Team, func(i, j int) bool { return user.Team[i].ID > user.Team[j].ID }) sort.Slice(expect.Team, func(i, j int) bool { return expect.Team[i].ID > expect.Team[j].ID })
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Tue Mar 19 03:50:28 GMT 2024 - 8K bytes - Viewed (0) -
tests/update_test.go
result.Team = append(user.Team, result.Team...) result.Friends = append(user.Friends, result.Friends...) sort.Slice(result.Pets, func(i, j int) bool { return result.Pets[i].ID < result.Pets[j].ID }) sort.Slice(result.Team, func(i, j int) bool { return result.Team[i].ID < result.Team[j].ID }) sort.Slice(result.Friends, func(i, j int) bool {
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Mon Dec 04 03:50:58 GMT 2023 - 30.3K bytes - Viewed (0) -
tests/migrate_test.go
t.Fatalf("Found deleted column") } } func TestMigrateConstraint(t *testing.T) { names := []string{"Account", "fk_users_account", "Pets", "fk_users_pets", "Company", "fk_users_company", "Team", "fk_users_team", "Languages", "fk_users_languages"} for _, name := range names { if !DB.Migrator().HasConstraint(&User{}, name) { DB.Migrator().CreateConstraint(&User{}, name) }
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Mon Mar 18 11:24:16 GMT 2024 - 56.2K bytes - Viewed (0) -
tests/delete_test.go
*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}),
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Tue Oct 10 07:03:34 GMT 2023 - 9.4K bytes - Viewed (0) -
tests/preload_test.go
user := *GetUser("user_without_associations", Config{}) DB.Create(&user) DB.Preload("Team").Preload("Languages").Preload("Friends").First(&user, "name = ?", user.Name) if r, err := json.Marshal(&user); err != nil { t.Errorf("failed to marshal users, got error %v", err) } else if !regexp.MustCompile(`"Team":\[\],"Languages":\[\],"Friends":\[\]`).MatchString(string(r)) {
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Thu Apr 25 12:21:03 GMT 2024 - 14.9K bytes - Viewed (0) -
tests/associations_many2many_test.go
*GetUser("slice-many2many-1", Config{Team: 2}), *GetUser("slice-many2many-2", Config{Team: 0}), *GetUser("slice-many2many-3", Config{Team: 4}), } DB.Create(&users) // Count AssertAssociationCount(t, users, "Team", 6, "") // Find var teams []User if DB.Model(&users).Association("Team").Find(&teams); len(teams) != 6 { t.Errorf("teams count should be %v, but got %v", 6, len(teams)) }
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Sat Jun 10 13:05:19 GMT 2023 - 13.2K bytes - Viewed (0) -
schema/schema_test.go
}, { Name: "Manager", Type: schema.BelongsTo, Schema: "User", FieldSchema: "User", References: []Reference{{"ID", "User", "ManagerID", "User", "", false}}, }, { Name: "Team", Type: schema.HasMany, Schema: "User", FieldSchema: "User", References: []Reference{{"ID", "User", "ManagerID", "User", "", true}}, }, {
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Fri Dec 15 08:31:23 GMT 2023 - 12.9K bytes - Viewed (0)