func UseCaptcha(db *periwinkle.Tx, id, token string) bool { o := GetCaptchaByID(db, id) if o == nil { panic("Captcha " + id + " does not exist.") } if strings.Compare(token, "true") == 0 { // destroy captcha db.Delete(&o) return true } // destroy captcha db.Delete(&o) return false }
func (usr *User) Delete(db *periwinkle.Tx) { if err := db.Delete(usr).Error; err != nil { dbError(err) } }
func (grp *Group) Delete(db *periwinkle.Tx) { if err := db.Delete(grp).Error; err != nil { dbError(err) } }
func (o *Session) Delete(db *periwinkle.Tx) { db.Delete(o) }