Merge pull request #3098 from consul/backport-1742-new_most_active_algorithm

[Backport] New algorithm for filter 'most active'
This commit is contained in:
Julian Nicolas Herrero
2018-12-13 12:46:18 +01:00
committed by GitHub
14 changed files with 243 additions and 87 deletions

View File

@@ -167,14 +167,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