Skip to content
This repository has been archived by the owner on Jun 24, 2019. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
fix: sort correctly by no users
We had a bad reference to badge_id in the query
  • Loading branch information
Christian Kruse committed Apr 8, 2015
1 parent a77474f commit 0ce982c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/badges_controller.rb
Expand Up @@ -3,7 +3,7 @@ def index
@limit = conf('pagination').to_i
@badges = sort_query(%w(score_needed badge_medal_type name no_users),
CfBadge.preload(:users),
no_users: 'SELECT COUNT(*) FROM badges_users WHERE badges_users.badge_id = badge_id')
no_users: 'SELECT COUNT(*) FROM badges_users WHERE badges_users.badge_id = badges.badge_id')
.page(params[:page]).per(@limit)


Expand Down

0 comments on commit 0ce982c

Please sign in to comment.