mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-30 19:08:10 -05:00
let's try another formula for the top tab
This commit is contained in:
parent
9c8e50351d
commit
b5a59c10d5
1 changed files with 2 additions and 7 deletions
|
@ -67,13 +67,8 @@ class TopTopic < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.compute_top_score_for(period)
|
def self.compute_top_score_for(period)
|
||||||
exec_sql("UPDATE top_topics
|
# log(views) + (posts * likes)
|
||||||
SET #{period}_score = log(
|
exec_sql("UPDATE top_topics SET #{period}_score = log(#{period}_views_count + 1) + (#{period}_posts_count * #{period}_likes_count)")
|
||||||
1 +
|
|
||||||
(#{period}_posts_count) *
|
|
||||||
(#{period}_likes_count / 2.0 + 1.0) *
|
|
||||||
(#{period}_views_count / 100.0 + 1.0)
|
|
||||||
)")
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.start_of(period)
|
def self.start_of(period)
|
||||||
|
|
Loading…
Reference in a new issue