add panic test
This commit is contained in:
parent
5d0bc6e309
commit
46387c7b55
@ -763,3 +763,7 @@ func TestUpdateReturning(t *testing.T) {
|
||||
t.Errorf("failed to return updated age column")
|
||||
}
|
||||
}
|
||||
|
||||
func TestAfterCreateWithPanic(t *testing.T) {
|
||||
DB.Model(User{}).Where("name=?", "update-1").Update("name", "update-1-1")
|
||||
}
|
||||
|
@ -31,6 +31,10 @@ type User struct {
|
||||
Active bool
|
||||
}
|
||||
|
||||
func (u *User) AfterCreate(tx *gorm.DB) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
type Account struct {
|
||||
gorm.Model
|
||||
UserID sql.NullInt64
|
||||
|
Loading…
x
Reference in New Issue
Block a user