Sort comments in sidebar by number of votes

This commit is contained in:
Amaia Castro
2017-02-09 12:42:00 +01:00
parent 60c7947cb4
commit d65f1998d0

View File

@@ -6,7 +6,7 @@
<% end %>
</div>
<div class="comments-wrapper">
<% annotation.comments.roots.sort_by_newest.limit(Legislation::Annotation::COMMENTS_PAGE_SIZE).each do |comment| %>
<% annotation.comments.roots.sort_by_most_voted.limit(Legislation::Annotation::COMMENTS_PAGE_SIZE).each do |comment| %>
<div class="comment">
<div class="comment-text">
<p><%= truncate comment.body, length: 250 %></p>