diff --git a/app/helpers/votes_helper.rb b/app/helpers/votes_helper.rb index 8292717e4..9772a8f04 100644 --- a/app/helpers/votes_helper.rb +++ b/app/helpers/votes_helper.rb @@ -1,6 +1,6 @@ module VotesHelper def debate_percentage_of_likes(debate) - debate.likes.percent_of(debate.total_votes) + (debate.likes.to_f * 100 / debate.total_votes).to_i end def votes_percentage(vote, debate) diff --git a/app/models/debate.rb b/app/models/debate.rb index 4316b4777..c4ca74af0 100644 --- a/app/models/debate.rb +++ b/app/models/debate.rb @@ -1,5 +1,3 @@ -require "numeric" - class Debate < ApplicationRecord include Flaggable include Taggable diff --git a/lib/numeric.rb b/lib/numeric.rb deleted file mode 100644 index ab9b212b9..000000000 --- a/lib/numeric.rb +++ /dev/null @@ -1,5 +0,0 @@ -class Numeric - def percent_of(n) - (to_f / n * 100).to_i - end -end