Skip to content

Commit 11c35c5

Browse files
committed
update
1 parent 09b3997 commit 11c35c5

File tree

2 files changed

+332
-1
lines changed

2 files changed

+332
-1
lines changed

apps/settings/controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func (c Controller) set(s string, object interface{}) {
3535
Ptr: object,
3636
}
3737
settings.Set(_type, obj)
38-
if db.Where("reference = ?", _type).Take(&obj).Error, gorm.ErrRecordNotFound){
38+
if db.Where("reference = ?", _type).Take(&obj).RowsAffected == 0 {
3939
db.Create(&obj)
4040
return
4141
}

0 commit comments

Comments
 (0)