- @election.voters.each do |voter|
- # skip if the voter has not voted or has an unconfirmed vote
- next unless voter.voted?
-
- plurality_tally << voter.vote.rankings.sort[0].candidate.id
- approval_tally << voter.vote.rankings.sort[0..1].collect \
- { |ranking| ranking.candidate.id }
- preference_tally << voter.vote.rankings.sort.collect \
- { |ranking| ranking.candidate.id }
+ private
+ def ident_to_quickvote(ident)
+ if ident.match(/^\d+$/)
+ quickvote = QuickVote.find(ident)
+ else
+ quickvote = QuickVote.find_all(["name = ?", ident])[0]