projects
/
selectricity
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
19a1975
)
fix bug/typo in plurality results around candidate.id and candidate_id
author
Benjamin Mako Hill
<mako@ephesus.xvm.mit.edu>
Sun, 17 Jun 2012 22:46:32 +0000
(18:46 -0400)
committer
Benjamin Mako Hill
<mako@ephesus.xvm.mit.edu>
Sun, 17 Jun 2012 22:46:32 +0000
(18:46 -0400)
app/models/election.rb
patch
|
blob
|
history
diff --git
a/app/models/election.rb
b/app/models/election.rb
index 9ce89b9b6baae86009ebc4b7ebdaef096e4dd970..7c15dcfcd785298c1e524702801d69fdfd4f3147 100644
(file)
--- 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?
# 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 \
approval_tally << voter.vote.rankings.sort[0..1].collect \
- { |ranking| ranking.candidate
.
id }
+ { |ranking| ranking.candidate
_
id }
preference_tally << voter.vote.rankings.sort.collect \
preference_tally << voter.vote.rankings.sort.collect \
- { |ranking| ranking.candidate
.
id }
+ { |ranking| ranking.candidate
_
id }
end
@plurality_result = PluralityVote.new(plurality_tally).result
end
@plurality_result = PluralityVote.new(plurality_tally).result
Benjamin Mako Hill
||
Want to submit a patch?