mirror of
https://github.com/discourse/discourse.git
synced 2025-09-11 21:04:42 +08:00
Backend changes to support improved badge pages.
This commit is contained in:
parent
386a45aab7
commit
2e52f795ea
4 changed files with 23 additions and 2 deletions
|
@ -14,7 +14,7 @@ class UserBadgesController < ApplicationController
|
|||
user_badges = user_badges.where('granted_at < ?', Time.at(params[:granted_before].to_f))
|
||||
end
|
||||
|
||||
user_badges = user_badges.includes(:user, :granted_by, badge: :badge_type)
|
||||
user_badges = user_badges.includes(:user, :granted_by, badge: :badge_type, post: :topic)
|
||||
|
||||
if params[:grouped]
|
||||
user_badges = user_badges.group(:badge_id).select(UserBadge.attribute_names.map {|x| "MAX(#{x}) as #{x}" }, 'COUNT(*) as count')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue