updated base model comments

This commit is contained in:
Gani Georgiev 2022-08-03 16:26:24 +03:00
parent bb00f198bc
commit 95f9d685dc
1 changed files with 2 additions and 3 deletions

View File

@ -44,7 +44,7 @@ type BaseModel struct {
Updated types.DateTime `db:"updated" json:"updated"`
}
// HasId returns whether the model has a nonzero primary key (aka. id).
// HasId returns whether the model has a nonzero id.
func (m *BaseModel) HasId() bool {
return m.GetId() != ""
}
@ -66,8 +66,7 @@ func (m *BaseModel) GetUpdated() types.DateTime {
// RefreshId generates and sets a new model id.
//
// The generated id is a cryptographically random 15 characters length string
// (could change in the future).
// The generated id is a cryptographically random 15 characters length string.
func (m *BaseModel) RefreshId() {
m.Id = security.RandomString(15)
}