Skip to content

Commit

Permalink
updated base model comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ganigeorgiev committed Aug 3, 2022
1 parent bb00f19 commit 95f9d68
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions models/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() != ""
}
Expand All @@ -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)
}
Expand Down

0 comments on commit 95f9d68

Please sign in to comment.