+ def destroy_rankings
+ rankings.each { |ranking| ranking.destroy }
+ end
+
+ def confirm!
+ self.confirmed = 1
+ self.save
+
+ unless self.voter.election.quickvote?
+ token.destroy and token.reload if token
+ self.token = Token.new
+ self.save
+ end
+ end
+
+ def confirm?
+ confirmed == 1
+ end
+
+ def votestring=(string="")
+ candidate_ids = voter.election.candidates.sort.collect \
+ { |candidate| candidate.id.to_i }
+
+ rel_votes = string.split("").collect { |vote| vote.to_i }
+
+ # covert relative orders to absolute candidate ids
+ self.votes = rel_votes.collect { |vote| candidate_ids[ vote - 1 ] }