diff --git a/lib/noosfero/api/v1/articles.rb b/lib/noosfero/api/v1/articles.rb index c78de07..67607cb 100644 --- a/lib/noosfero/api/v1/articles.rb +++ b/lib/noosfero/api/v1/articles.rb @@ -37,7 +37,7 @@ module Noosfero articles = articles.display_filter(current_person, nil) if votes_order - articles = articles.joins('left join votes on articles.id=votes.voteable_id').group('articles.id').order('sum(votes.id) DESC') + articles = articles.joins('left join votes on articles.id=votes.voteable_id').group('articles.id').reorder('sum(votes.id) DESC') end present articles, :with => Entities::Article, :fields => params[:fields] -- libgit2 0.21.2