fix poll accuracy results using floats

This commit is contained in:
Juanjo Bazán
2018-11-11 14:54:35 +01:00
parent c25eb694bc
commit 4cccb93677

View File

@@ -46,7 +46,7 @@ class Poll::Question::Answer < ActiveRecord::Base
end
def total_votes_percentage
question.answers_total_votes.zero? ? 0 : (total_votes * 100) / question.answers_total_votes
question.answers_total_votes.zero? ? 0 : (total_votes * 100.0) / question.answers_total_votes
end
def set_most_voted