X-Git-Url: https://projects.mako.cc/source/selectricity-live/blobdiff_plain/d799e41626ef94ab28a3b5517dd2ed7d1e6b1001..005f5a86085c9cbcbc09c6655f3851a877462638:/app/models/election.rb diff --git a/app/models/election.rb b/app/models/election.rb index 4ce571a..b48c923 100644 --- a/app/models/election.rb +++ b/app/models/election.rb @@ -137,11 +137,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