FEATURE: top topics all time

tweak top algorithm (we will continue next week)
This commit is contained in:
Sam
2015-03-06 18:00:29 +11:00
parent db7a225df7
commit 2a586d59e9
4 changed files with 65 additions and 8 deletions

View File

@@ -0,0 +1,10 @@
class AddAllTimeAndOpLikesToTopTopics < ActiveRecord::Migration
def change
add_column :top_topics, :all_score, :float, default: 0
[:daily, :weekly, :monthly, :yearly].each do |period|
column = "#{period}_op_likes_count"
add_column :top_topics, column, :integer, default: 0, null: false
add_index :top_topics, [column]
end
end
end