Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for FavChildID (0.3 sec)

  1. tests/associations_test.go

    	DB.Create(&child)
    
    	parent.FavChildID = child.ID
    	parent.FavChild = &child
    	DB.Save(&parent)
    
    	var parent1 Parent
    	DB.First(&parent1, parent.ID)
    	AssertObjEqual(t, parent, parent1, "ID", "FavChildID")
    
    	// Save and Updates is the same
    	DB.Updates(&parent)
    	DB.First(&parent1, parent.ID)
    	AssertObjEqual(t, parent, parent1, "ID", "FavChildID")
    }
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Wed Feb 08 08:29:09 GMT 2023
    - 10.9K bytes
    - Viewed (0)
  2. utils/tests/models.go

    	ProductId string `gorm:"primarykey;size:255"`
    	Desc      string
    }
    
    type Order struct {
    	gorm.Model
    	Num      string
    	Coupon   *Coupon
    	CouponID string
    }
    
    type Parent struct {
    	gorm.Model
    	FavChildID uint
    	FavChild   *Child
    	Children   []*Child
    }
    
    type Child struct {
    	gorm.Model
    	Name     string
    	ParentID *uint
    	Parent   *Parent
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Dec 15 08:36:08 GMT 2023
    - 2.1K bytes
    - Viewed (0)
Back to top