Commit bc2a9e1f by Rocky Duan

return type of content & disable cache for now

parent 40d2c2ad
......@@ -51,9 +51,9 @@ namespace :db do
Subscription.delete_all
end
THREADS_PER_COMMENTABLE = 3
TOP_COMMENTS_PER_THREAD = 2
ADDITIONAL_COMMENTS_PER_THREAD = 1
THREADS_PER_COMMENTABLE = 20
TOP_COMMENTS_PER_THREAD = 3
ADDITIONAL_COMMENTS_PER_THREAD = 5
COURSE_ID = "MITx/6.002x/2012_Fall"
......
level_limit: 3
cache_enabled: true
cache_enabled: false
cache_timeout:
threads_search: 60
threads_query: 60
threads_search: 10
threads_query: 10
......@@ -56,6 +56,7 @@ class Comment < Content
.merge("closed" => comment_thread.closed)
.merge("thread_id" => comment_thread.id)
.merge("votes" => votes.slice(*%w[count up_count down_count point]))
.merge("type" => "comment")
end
end
......
......@@ -154,6 +154,7 @@ class CommentThread < Content
.merge("username" => author.username)
.merge("votes" => votes.slice(*%w[count up_count down_count point]))
.merge("tags" => tags_array)
.merge("type" => "thread")
if params[:recursive]
doc = doc.merge("children" => root_comments.map{|c| c.to_hash(recursive: true)})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment