pull/382/merge v0.2.0
Jordan Wright 2016-11-13 20:54:38 -06:00
commit baec4ed5ca
1 changed files with 1 additions and 1 deletions

View File

@ -74,7 +74,7 @@ func (r *Result) GenerateId() {
for { for {
io.ReadFull(rand.Reader, k) io.ReadFull(rand.Reader, k)
r.RId = fmt.Sprintf("%x", 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 { if err == gorm.ErrRecordNotFound {
break break
} }