From c4072579c6b3e80d8f05768a9a68bc9ad7490b3c Mon Sep 17 00:00:00 2001 From: Benjamin Mako Hill Date: Sun, 17 Jun 2012 18:46:32 -0400 Subject: [PATCH] fix bug/typo in plurality results around candidate.id and candidate_id --- app/models/election.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/election.rb b/app/models/election.rb index 9ce89b9..7c15dcf 100644 --- a/app/models/election.rb +++ b/app/models/election.rb @@ -141,11 +141,11 @@ class Election < ActiveRecord::Base # 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 -- 2.39.5