Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for id (0.11 sec)

  1. tests/hooks_test.go

    	DB.Model(&Product5{}).Create(&p)
    
    	err := DB.Model(&Product5{}).Where("id", p.ID).Update("name", "update_name_1").Error
    	if err != nil {
    		t.Fatalf("should update success, but got err %v", err)
    	}
    	if beforeUpdateCall != 1 {
    		t.Fatalf("before update should be called")
    	}
    
    	err = DB.Model(Product5{}).Where("id", p.ID).Update("name", "update_name_2").Error
    	if !errors.Is(err, gorm.ErrInvalidValue) {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Feb 18 01:20:29 GMT 2023
    - 15.9K bytes
    - Viewed (0)
Back to top