new algorithm for filter 'most active'

This commit is contained in:
Julian Herrero
2018-12-11 16:02:08 +01:00
parent 96dfa2fd65
commit ef835bef1c
9 changed files with 230 additions and 87 deletions

View File

@@ -166,14 +166,11 @@ class Proposal < ActiveRecord::Base
end
def after_commented
save # updates the hot_score because there is a before_save
save # update cache when it has a new comment
end
def calculate_hot_score
self.hot_score = ScoreCalculator.hot_score(created_at,
total_votes,
total_votes,
comments_count)
self.hot_score = ScoreCalculator.hot_score(self)
end
def calculate_confidence_score