Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for ManagerID (0.08 sec)

  1. tests/helper_test.go

    		if user.Manager != nil {
    			if user.ManagerID == nil {
    				t.Errorf("Manager's foreign key should be saved")
    			} else {
    				var manager User
    				db(unscoped).First(&manager, "id = ?", *user.ManagerID)
    				AssertObjEqual(t, manager, user.Manager, "ID", "CreatedAt", "UpdatedAt", "DeletedAt", "Name", "Age",
    					"Birthday", "CompanyID", "ManagerID", "Active")
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Tue Mar 19 03:50:28 UTC 2024
    - 8K bytes
    - Viewed (0)
  2. schema/schema_test.go

    		{Name: "CompanyID", DBName: "company_id", BindNames: []string{"CompanyID"}, DataType: schema.Int, Size: 64},
    		{Name: "ManagerID", DBName: "manager_id", BindNames: []string{"ManagerID"}, DataType: schema.Uint, Size: 64},
    		{Name: "Active", DBName: "active", BindNames: []string{"Active"}, DataType: schema.Bool},
    	}
    
    	for i := range fields {
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Thu Jun 20 12:19:31 UTC 2024
    - 13.3K bytes
    - Viewed (0)
  3. utils/tests/models.go

    	Account   Account
    	Pets      []*Pet
    	NamedPet  *Pet
    	Toys      []Toy   `gorm:"polymorphic:Owner"`
    	Tools     []Tools `gorm:"polymorphicType:Type;polymorphicId:CustomID"`
    	CompanyID *int
    	Company   Company
    	ManagerID *uint
    	Manager   *User
    	Team      []User     `gorm:"foreignkey:ManagerID"`
    	Languages []Language `gorm:"many2many:UserSpeak;"`
    	Friends   []*User    `gorm:"many2many:user_friends;"`
    	Active    bool
    }
    
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Fri Dec 15 08:36:08 UTC 2023
    - 2.1K bytes
    - Viewed (0)
  4. tests/associations_belongs_to_test.go

    	}
    
    	if manager.ID == 0 {
    		t.Fatalf("Manager's ID should be created")
    	}
    
    	user.Company = company
    	user.Manager = manager
    	user.CompanyID = &company.ID
    	user.ManagerID = &manager.ID
    	CheckUser(t, user2, user)
    
    	AssertAssociationCount(t, user2, "Company", 1, "AfterAppend")
    	AssertAssociationCount(t, user2, "Manager", 1, "AfterAppend")
    
    	// Replace
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Mon Oct 30 09:15:49 UTC 2023
    - 9.3K bytes
    - Viewed (0)
  5. schema/model_test.go

    	Name      *string
    	Age       *uint
    	Birthday  *time.Time
    	Account   *tests.Account
    	Pets      []*tests.Pet
    	Toys      []*tests.Toy `gorm:"polymorphic:Owner"`
    	CompanyID *int
    	Company   *tests.Company
    	ManagerID *uint
    	Manager   *User
    	Team      []*User           `gorm:"foreignkey:ManagerID"`
    	Languages []*tests.Language `gorm:"many2many:UserSpeak"`
    	Friends   []*User           `gorm:"many2many:user_friends"`
    	Active    *bool
    }
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Thu Jan 06 07:02:53 UTC 2022
    - 1.1K bytes
    - Viewed (0)
  6. tests/update_test.go

    	result.Company = user2.Company
    	result.Manager = user2.Manager
    	result.Team = user2.Team
    	result.Languages = user2.Languages
    	result.Friends = user2.Friends
    
    	DB.Select("Name", "Account", "Toys", "Manager", "ManagerID", "Languages").Save(&result)
    
    	var result2 User
    	DB.Preload("Account").Preload("Pets").Preload("Toys").Preload("Company").Preload("Manager").Preload("Team").Preload("Languages").Preload("Friends").First(&result2, user.ID)
    
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Mon Dec 04 03:50:58 UTC 2023
    - 30.3K bytes
    - Viewed (0)
  7. tests/joins_test.go

    }
    
    func TestJoinsPreload_Issue7013(t *testing.T) {
    	manager := &User{Name: "Manager"}
    	DB.Create(manager)
    
    	var userIDs []uint
    	for i := 0; i < 21; i++ {
    		user := &User{Name: fmt.Sprintf("User%d", i), ManagerID: &manager.ID}
    		DB.Create(user)
    		userIDs = append(userIDs, user.ID)
    	}
    
    	var entries []User
    	assert.NotPanics(t, func() {
    		assert.NoError(t,
    			DB.Debug().Preload("Manager.Team").
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Mon Jun 17 03:58:13 UTC 2024
    - 15K bytes
    - Viewed (0)
  8. tests/scan_test.go

    			Name:    "TestScanToEmbedded_1_m1",
    			Manager: &User{Name: "TestScanToEmbedded_1_m1_m1"},
    		},
    	}
    	DB.Create(&user)
    
    	type UserScan struct {
    		ID        uint
    		Name      string
    		ManagerID *uint
    	}
    	var user2 UserScan
    	err := DB.Raw("SELECT * FROM users INNER JOIN users Manager ON users.manager_id = Manager.id WHERE users.id = ?", user.ID).Scan(&user2).Error
    	AssertEqual(t, err, nil)
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Wed Jun 12 10:57:36 UTC 2024
    - 10.9K bytes
    - Viewed (0)
  9. tests/create_test.go

    func TestSelectWithCreate(t *testing.T) {
    	user := *GetUser("select_create", Config{Account: true, Pets: 3, Toys: 3, Company: true, Manager: true, Team: 3, Languages: 3, Friends: 4})
    	DB.Select("Account", "Toys", "Manager", "ManagerID", "Languages", "Name", "CreatedAt", "Age", "Active").Create(&user)
    
    	var user2 User
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Tue Mar 19 03:50:28 UTC 2024
    - 26.4K bytes
    - Viewed (0)
  10. tests/migrate_test.go

    		t.Fatalf("Failed to auto migrate: error: %v", err)
    	}
    }
    
    func TestAutoMigrateSelfReferential(t *testing.T) {
    	type MigratePerson struct {
    		ID        uint
    		Name      string
    		ManagerID *uint
    		Manager   *MigratePerson
    	}
    
    	DB.Migrator().DropTable(&MigratePerson{})
    
    	if err := DB.AutoMigrate(&MigratePerson{}); err != nil {
    		t.Fatalf("Failed to auto migrate, but got error %v", err)
    	}
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Mon Mar 18 11:24:16 UTC 2024
    - 56.2K bytes
    - Viewed (0)
Back to top