- Sort Score
- Result 10 results
- Languages All
Results 1 - 4 of 4 for iter (0.13 sec)
-
tests/associations_has_many_test.go
LanguageCode string `gorm:"not null;type:varchar(2)"` } type Item struct { gorm.Model Logo string `gorm:"not null;type:varchar(50)"` Contents []ItemContent `gorm:"foreignKey:ItemID"` } tx := DB.Session(&gorm.Session{}) tx.Migrator().DropTable(&ItemContent{}, &Item{}) tx.AutoMigrate(&ItemContent{}, &Item{}) item := Item{ Logo: "logo", Contents: []ItemContent{
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/hooks_test.go
var productWithItem Product4 if err := DB.Session(&gorm.Session{SkipHooks: true}).Preload("Item").First(&productWithItem, "name = ?", product.Name).Error; err != nil { t.Errorf("should find product, but got error %v", err) } if productWithItem.Item.AfterFindCallTimes != 0 { t.Fatalf("AfterFind should not be called times:%d", productWithItem.Item.AfterFindCallTimes) } } type Product5 struct { gorm.Model Name string
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Sat Feb 18 01:20:29 GMT 2023 - 15.9K bytes - Viewed (0) -
tests/associations_belongs_to_test.go
tx.AutoMigrate(&ItemParent{}, &ItemChild{}) item := ItemChild{ Name: "name", ItemParent: ItemParent{ Logo: "logo", }, } if err := tx.Create(&item).Error; err != nil { t.Fatalf("failed to create items, got error: %v", err) } // test replace if err := tx.Model(&item).Association("ItemParent").Unscoped().Replace(&ItemParent{ Logo: "updated logo",
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Mon Oct 30 09:15:49 GMT 2023 - 9.3K bytes - Viewed (0) -
tests/query_test.go
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Thu Apr 25 12:22:53 GMT 2024 - 49.8K bytes - Viewed (0)