From bf7108295390aa69eeaeb21ee3be0ffcda8e44ed Mon Sep 17 00:00:00 2001 From: s vignesh Date: Mon, 14 Nov 2016 07:10:06 +0530 Subject: [PATCH] Correction in Generate Rid (#424) --- models/result.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/result.go b/models/result.go index f5d43816..7b7178d8 100644 --- a/models/result.go +++ b/models/result.go @@ -74,7 +74,7 @@ func (r *Result) GenerateId() { for { io.ReadFull(rand.Reader, k) r.RId = fmt.Sprintf("%x", k) - err := db.Table("results").Where("id=?", r.RId).First(&Result{}).Error + err := db.Table("results").Where("r_id=?", r.RId).First(&Result{}).Error if err == gorm.ErrRecordNotFound { break }