PERF: N+1 query on user summary page.
This commit is contained in:
parent
bddbfa56f6
commit
4e663998af
|
@ -33,7 +33,11 @@ class UsersController < ApplicationController
|
|||
def show
|
||||
raise Discourse::InvalidAccess if SiteSetting.hide_user_profiles_from_public && !current_user
|
||||
|
||||
@user = fetch_user_from_params(include_inactive: current_user.try(:staff?))
|
||||
@user = fetch_user_from_params(
|
||||
{ include_inactive: current_user.try(:staff?) },
|
||||
[{ user_profile: :card_image_badge }]
|
||||
)
|
||||
|
||||
user_serializer = UserSerializer.new(@user, scope: guardian, root: 'user')
|
||||
|
||||
# TODO remove this options from serializer
|
||||
|
|
Loading…
Reference in New Issue