From a11bf979adb00be6ad8b77a09fb757d62c35676a Mon Sep 17 00:00:00 2001 From: James Cash Date: Sat, 19 Sep 2009 17:19:52 -0400 Subject: [PATCH] Changing check for spoiled ballots to something that actually makes sense --- app/helpers/application_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 5e40c92..7a0e4fc 100755 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -14,7 +14,7 @@ def calculate_winner_preferential election total = candidates.values.sum # Check if the majority of votes were spoiled, in which case the election is void - spoiled = candidates.keys.select { |c| c == 0 }.size + spoiled = candidates[0] if spoiled > total/2.0 return [:spoiled , spoiled] # How do we want to indicate this? end