mirror of
https://github.com/go-gorm/gorm.git
synced 2025-01-23 10:50:28 +08:00
fix: 注释错误
parent
1096c9ca9a
commit
e4c3b3a4d0
@ -436,7 +436,7 @@ When updating with `Update`, `Updates`, You can use `Changed` method in Hooks `B
|
||||
|
||||
```go
|
||||
func (user *User) BeforeUpdate(tx *gorm.DB) error {
|
||||
if tx.Statement.Changed("Name", "Admin") { // if Name or Role changed
|
||||
if tx.Statement.Changed("Name", "Admin") { // if Name or Admin changed
|
||||
tx.Statement.SetColumn("Age", 18)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user