remove redundancy in models BeforeInsert hook

This commit is contained in:
dhax 2017-10-13 01:01:31 +02:00
parent c3271d7dcf
commit 2dc0f02d1c
2 changed files with 2 additions and 8 deletions

View file

@ -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.