remove redundancy in models BeforeInsert hook
This commit is contained in:
parent
c3271d7dcf
commit
2dc0f02d1c
2 changed files with 2 additions and 8 deletions
|
|
@ -33,10 +33,7 @@ func (a *Account) BeforeInsert(db orm.DB) error {
|
|||
a.CreatedAt = now
|
||||
a.UpdatedAt = now
|
||||
}
|
||||
if err := a.Validate(); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return a.Validate()
|
||||
}
|
||||
|
||||
// BeforeUpdate hook executed before database update operation.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue