mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-04-29 15:35:23 -04:00
PERF: N+1 query on user summary page.
This commit is contained in:
parent
bddbfa56f6
commit
4e663998af
1 changed files with 5 additions and 1 deletions
|
@ -33,7 +33,11 @@ class UsersController < ApplicationController
|
||||||
def show
|
def show
|
||||||
raise Discourse::InvalidAccess if SiteSetting.hide_user_profiles_from_public && !current_user
|
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')
|
user_serializer = UserSerializer.new(@user, scope: guardian, root: 'user')
|
||||||
|
|
||||||
# TODO remove this options from serializer
|
# TODO remove this options from serializer
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue