- Sort Score
- Result 10 results
- Languages All
Results 1 - 2 of 2 for AppliesToProduct (0.12 sec)
-
tests/associations_test.go
t.Errorf("failed to create orders, got %v", err) } coupon2 := Coupon{ AppliesToProduct: []*CouponProduct{{Desc: "coupon-description"}}, } DB.Session(&gorm.Session{FullSaveAssociations: true}).Create(&coupon2) var result Coupon if err := DB.Preload("AppliesToProduct").First(&result, "id = ?", coupon2.ID).Error; err != nil { t.Errorf("Failed to create coupon w/o name, got error: %v", err)
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Wed Feb 08 08:29:09 UTC 2023 - 10.9K bytes - Viewed (0) -
utils/tests/models.go
ID int Name string } type Language struct { Code string `gorm:"primarykey"` Name string } type Coupon struct { ID int `gorm:"primarykey; size:255"` AppliesToProduct []*CouponProduct `gorm:"foreignKey:CouponId;constraint:OnDelete:CASCADE"` AmountOff uint32 `gorm:"column:amount_off"` PercentOff float32 `gorm:"column:percent_off"` }
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Fri Dec 15 08:36:08 UTC 2023 - 2.1K bytes - Viewed (0)