Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for NamedPet (0.14 sec)

  1. utils/tests/models.go

    // His pet also has one Toy (has one - polymorphic)
    // NamedPet is a reference to a named `Pet` (has one)
    type User struct {
    	gorm.Model
    	Name      string
    	Age       uint
    	Birthday  *time.Time
    	Account   Account
    	Pets      []*Pet
    	NamedPet  *Pet
    	Toys      []Toy   `gorm:"polymorphic:Owner"`
    	Tools     []Tools `gorm:"polymorphicType:Type;polymorphicId:CustomID"`
    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)
  2. tests/helper_test.go

    		user.Languages = append(user.Languages, language)
    	}
    
    	for i := 0; i < config.Friends; i++ {
    		user.Friends = append(user.Friends, GetUser(name+"_friend_"+strconv.Itoa(i+1), Config{}))
    	}
    
    	if config.NamedPet {
    		user.NamedPet = &Pet{Name: name + "_namepet"}
    	}
    
    	return &user
    }
    
    func CheckPetUnscoped(t *testing.T, pet Pet, expect Pet) {
    	doCheckPet(t, pet, expect, true)
    }
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Mar 19 03:50:28 GMT 2024
    - 8K bytes
    - Viewed (0)
Back to top