Commit 9d67b0b9767cada69f990a17af01fd87806c437e

Authored by Victor Costa
Committed by Rodrigo Souto
1 parent 95b0b53a

api: fix votes 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').reorder('sum(votes.id) DESC')
  40 + articles = articles.joins(:votes).group('articles.id').reorder('sum(votes.id) DESC')
41 41 end
42 42  
43 43 present articles, :with => Entities::Article, :fields => params[:fields]
... ...