Replace == 0 comparisions for .zero?

This commit is contained in:
Bertocq
2017-11-13 02:27:38 +01:00
parent bfd1a75af7
commit db54273dad
2 changed files with 10 additions and 10 deletions

View File

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