mirror of
https://github.com/discourse/discourse.git
synced 2025-06-02 16:29:32 +08:00
Add rubocop to our build. (#5004)
This commit is contained in:
@ -33,12 +33,12 @@ class UserBadgesController < ApplicationController
|
||||
|
||||
if params[:grouped]
|
||||
user_badges = user_badges.group(:badge_id)
|
||||
.select(UserBadge.attribute_names.map {|x| "MAX(#{x}) AS #{x}" }, 'COUNT(*) AS "count"')
|
||||
.select(UserBadge.attribute_names.map { |x| "MAX(#{x}) AS #{x}" }, 'COUNT(*) AS "count"')
|
||||
end
|
||||
|
||||
user_badges = user_badges.includes(badge: [:badge_grouping, :badge_type])
|
||||
.includes(post: :topic)
|
||||
.includes(:granted_by)
|
||||
.includes(post: :topic)
|
||||
.includes(:granted_by)
|
||||
|
||||
render_serialized(user_badges, DetailedUserBadgeSerializer, root: :user_badges)
|
||||
end
|
||||
@ -104,6 +104,6 @@ class UserBadgesController < ApplicationController
|
||||
|
||||
def can_assign_badge_to_user?(user)
|
||||
master_api_call = current_user.nil? && is_api?
|
||||
master_api_call or guardian.can_grant_badges?(user)
|
||||
master_api_call || guardian.can_grant_badges?(user)
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user