Comment: regardless of confidence, negative thread-leaders go

This commit is contained in:
Carl Chenet 2017-05-16 18:50:50 +02:00
parent d2a873a4e9
commit 64c4682cc7

View file

@ -50,7 +50,8 @@ class Comment < ActiveRecord::Base
end
def self.arrange_for_user(user)
parents = self.order("confidence DESC").group_by(&:parent_comment_id)
parents = self.order("(upvotes - downvotes) < 0 ASC, confidence DESC").
group_by(&:parent_comment_id)
# top-down list of comments, regardless of indent level
ordered = []