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