Commit 95b0b53a6fb5d3e9b8766aa6b09cb2bfc8056cff
Committed by
Rodrigo Souto
1 parent
10856688
Exists in
api_tasks
and in
4 other branches
api: fix vote score order
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
lib/noosfero/api/v1/articles.rb
... | ... | @@ -37,7 +37,7 @@ module Noosfero |
37 | 37 | articles = articles.display_filter(current_person, nil) |
38 | 38 | |
39 | 39 | if votes_order |
40 | - articles = articles.joins('left join votes on articles.id=votes.voteable_id').group('articles.id').order('sum(votes.id) DESC') | |
40 | + articles = articles.joins('left join votes on articles.id=votes.voteable_id').group('articles.id').reorder('sum(votes.id) DESC') | |
41 | 41 | end |
42 | 42 | |
43 | 43 | present articles, :with => Entities::Article, :fields => params[:fields] | ... | ... |