- 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 ] }
- end
-