Skip to content

Commit

Permalink
change comments order to asc
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-klimuk authored and jywarren committed Oct 28, 2016
1 parent f1f6368 commit 72e4820
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/models/concerns/node_shared.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ def liked_by(uid)
self.likers.collect(&:uid).include?(uid)
end

def comments
def comments(direction = 'DESC')
self.drupal_comments
.order('timestamp DESC')
.order("timestamp #{direction}")
end
end
2 changes: 1 addition & 1 deletion app/views/questions/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
<% end %>
</div>

<% @node.comments.each do |comment| %>
<% @node.comments('ASC').each do |comment| %>
<%= render partial: "questions/comment", locals: { comment: comment, answer_id: 0 } %>
<% end %>

Expand Down

0 comments on commit 72e4820

Please sign in to comment.