Commit dbffdf3c9eee304d2c6883a79c18a4912ebf4aab
1 parent
a0e3f036
Exists in
theme-brasil-digital-from-staging
and in
9 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] | ... | ... |