end
def quickvote?
- self.class == 'QuickVote'
+ self.class == QuickVote
end
def active?
# 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
+ plurality_tally << voter.vote.rankings.sort[0].candidate_id
approval_tally << voter.vote.rankings.sort[0..1].collect \
- { |ranking| ranking.candidate.id }
+ { |ranking| ranking.candidate_id }
preference_tally << voter.vote.rankings.sort.collect \
- { |ranking| ranking.candidate.id }
+ { |ranking| ranking.candidate_id }
end
@plurality_result = PluralityVote.new(plurality_tally).result