Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for Larentis (0.23 sec)

  1. utils/tests/models.go

    	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)
  2. tests/associations_belongs_to_test.go

    	}
    
    	var parents []ItemParent
    	if err := tx.Find(&parents).Error; err != nil {
    		t.Errorf("failed to find item parent, got error: %v", err)
    	}
    	if len(parents) != 1 {
    		t.Errorf("expected %d parents, got %d", 1, len(parents))
    	}
    
    	// test delete
    	if err := tx.Model(&item).Association("ItemParent").Unscoped().Delete(&parents); err != nil {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Oct 30 09:15:49 GMT 2023
    - 9.3K bytes
    - Viewed (0)
  3. tests/associations_test.go

    }
    
    func TestSaveHasManyCircularReference(t *testing.T) {
    	parent := Parent{}
    	DB.Create(&parent)
    
    	child := Child{ParentID: &parent.ID, Parent: &parent, Name: "HasManyCircularReference"}
    	child1 := Child{ParentID: &parent.ID, Parent: &parent, Name: "HasManyCircularReference1"}
    
    	parent.Children = []*Child{&child, &child1}
    	DB.Save(&parent)
    
    	var children []*Child
    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)
Back to top