Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 52 for COMPANY (0.2 sec)

  1. tests/update_belongs_to_test.go

    	}
    
    	user.Company = Company{Name: "company-belongs-to-association"}
    	user.Manager = &User{Name: "manager-belongs-to-association"}
    	if err := DB.Save(&user).Error; err != nil {
    		t.Fatalf("errors happened when update: %v", err)
    	}
    
    	var user2 User
    	DB.Preload("Company").Preload("Manager").Find(&user2, "id = ?", user.ID)
    	CheckUser(t, user2, user)
    
    	user.Company.Name += "new"
    	user.Manager.Name += "new"
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Thu Jul 14 06:55:54 GMT 2022
    - 1.6K bytes
    - Viewed (0)
  2. tests/associations_belongs_to_test.go

    	// Count
    	AssertAssociationCount(t, user, "Company", 1, "")
    	AssertAssociationCount(t, user, "Manager", 1, "")
    
    	// Append
    	company := Company{Name: "company-belongs-to-append"}
    	manager := GetUser("manager-belongs-to-append", Config{})
    
    	if err := DB.Model(&user2).Association("Company").Append(&company); err != nil {
    		t.Fatalf("Error happened when append Company, got %v", err)
    	}
    
    	if company.ID == 0 {
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Mon Oct 30 09:15:49 GMT 2023
    - 9.3K bytes
    - Viewed (0)
  3. tests/update_test.go

    	if result.Name != "new company name" {
    		t.Errorf("name should be %v, but got %v", user.Company.Name, result.Name)
    	}
    }
    
    func TestIdempotentSave(t *testing.T) {
    	create := Company{
    		Name: "company_idempotent",
    	}
    	DB.Create(&create)
    
    	var company Company
    	if err := DB.Find(&company, "id = ?", create.ID).Error; err != nil {
    		t.Fatalf("failed to find created company, got err: %v", err)
    	}
    
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Mon Dec 04 03:50:58 GMT 2023
    - 30.3K bytes
    - Viewed (0)
  4. schema/schema_test.go

    		{Name: "ID", DBName: "company_id", BindNames: []string{"Base", "ID"}, DataType: schema.Int, Size: 64, TagSettings: map[string]string{"EMBEDDED": "EMBEDDED", "EMBEDDEDPREFIX": "company_"}},
    		{Name: "Name", DBName: "company_name", BindNames: []string{"Base", "Name"}, DataType: schema.String, TagSettings: map[string]string{"EMBEDDED": "EMBEDDED", "EMBEDDEDPREFIX": "company_"}},
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Fri Dec 15 08:31:23 GMT 2023
    - 12.9K bytes
    - Viewed (0)
  5. utils/tests/models.go

    	Birthday  *time.Time
    	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
    }
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Fri Dec 15 08:36:08 GMT 2023
    - 2.1K bytes
    - Viewed (0)
  6. statement_test.go

    		"`Table`.`nAme`":     {"Table", "nAme"},
    		"my_table.*":         {"my_table", "*"},
    		"`my_table`.*":       {"my_table", "*"},
    		"User__Company.*":    {"User__Company", "*"},
    		"`User__Company`.*":  {"User__Company", "*"},
    		`"User__Company".*`:  {"User__Company", "*"},
    		`"table"."*"`:        {"", ""},
    	} {
    		if table, column := matchName(k); table != v[0] || column != v[1] {
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Sat Dec 23 13:19:41 GMT 2023
    - 1.9K bytes
    - Viewed (0)
  7. tests/delete_test.go

    		*GetUser("delete_slice_with_associations1", Config{Account: true, Pets: 4, Toys: 1, Company: true, Manager: true, Team: 1, Languages: 1, Friends: 4}),
    		*GetUser("delete_slice_with_associations2", Config{Account: true, Pets: 3, Toys: 2, Company: true, Manager: true, Team: 2, Languages: 2, Friends: 3}),
    		*GetUser("delete_slice_with_associations3", Config{Account: true, Pets: 2, Toys: 3, Company: true, Manager: true, Team: 3, Languages: 3, Friends: 2}),
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Tue Oct 10 07:03:34 GMT 2023
    - 9.4K bytes
    - Viewed (0)
  8. schema/naming_test.go

    	}
    
    	joinTable2 := ns.JoinTableName("UserLanguage")
    	if joinTable2 != "public.user_language" {
    		t.Errorf("invalid join table generated, got %v", joinTable2)
    	}
    
    	tableName := ns.TableName("Company")
    	if tableName != "public.company" {
    		t.Errorf("invalid table name generated, got %v", tableName)
    	}
    
    	columdName := ns.ColumnName("", "NameCID")
    	if columdName != "name_cid" {
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Tue May 30 02:00:48 GMT 2023
    - 7K bytes
    - Viewed (0)
  9. tests/create_test.go

    	}
    }
    
    func TestFirstOrCreateWithPrimaryKey(t *testing.T) {
    	company := Company{ID: 100, Name: "company100_with_primarykey"}
    	DB.FirstOrCreate(&company)
    
    	if company.ID != 100 {
    		t.Errorf("invalid primary key after creating, got %v", company.ID)
    	}
    
    	companies := []Company{
    		{ID: 101, Name: "company101_with_primarykey"},
    		{ID: 102, Name: "company102_with_primarykey"},
    	}
    	DB.Create(&companies)
    
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Tue Mar 19 03:50:28 GMT 2024
    - 26.4K bytes
    - Viewed (0)
  10. tests/helper_test.go

    	}
    
    	for i := 0; i < config.Tools; i++ {
    		user.Tools = append(user.Tools, Tools{Name: name + "_tool_" + strconv.Itoa(i+1)})
    	}
    
    	if config.Company {
    		user.Company = Company{Name: "company-" + name}
    	}
    
    	if config.Manager {
    		user.Manager = GetUser(name+"_manager", Config{})
    	}
    
    	for i := 0; i < config.Team; i++ {
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Tue Mar 19 03:50:28 GMT 2024
    - 8K bytes
    - Viewed (0)
Back to top