From 7edb88a5a8f1d0d98537f1e7ecb36a04f8fd1199 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Wed, 3 Dec 2014 11:51:49 +0100 Subject: [PATCH] FIX: change top score formula Adds more weight to `likes` (it's now the same weight as `post_count`) --- app/models/top_topic.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/top_topic.rb b/app/models/top_topic.rb index cad2eebc9..9905a7b32 100644 --- a/app/models/top_topic.rb +++ b/app/models/top_topic.rb @@ -119,7 +119,7 @@ class TopTopic < ActiveRecord::Base WITH top AS ( SELECT CASE WHEN topics.created_at < :from THEN 0 - ELSE log(greatest(#{period}_views_count, 1)) + #{period}_likes_count + #{period}_posts_count * 2 + ELSE log(greatest(#{period}_views_count, 1)) + #{period}_likes_count * 2 + #{period}_posts_count * 2 END AS score, topic_id FROM top_topics