X-Git-Url: https://projects.mako.cc/source/selectricity/blobdiff_plain/597d4add3416d06c2befb6368a06f6cea4215a39..9a15981ecd4893c6ca1e6c0e89da0b497824d1f9:/app/models/election.rb 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