updated Dao.Save godoc

This commit is contained in:
Gani Georgiev
2023-03-30 21:19:14 +03:00
parent 29a264e132
commit 216efb95a8
3 changed files with 12 additions and 3 deletions

View File

@@ -205,7 +205,10 @@ func (dao *Dao) Delete(m models.Model) error {
})
}
// Save upserts (update or create if primary key is not set) the provided model.
// Save persists the provided model in the database.
//
// If m.IsNew() is true, the method will perform a create, otherwise an update.
// To explicitly mark a model for update you can use m.MarkAsNotNew().
func (dao *Dao) Save(m models.Model) error {
if m.IsNew() {
return dao.lockRetry(func(retryDao *Dao) error {