Logo
Explore Help
Sign In
IntenseWebs/discourse
3
0
Fork 0
You've already forked discourse
mirror of https://github.com/discourse/discourse.git synced 2025-02-25 18:55:32 -06:00
Code Issues Packages Projects Releases Wiki Activity
Files
34d158c4aa24c7d64cc33be0a32473fa9e014094
discourse/plugins/chat/app/serializers/user_chat_channel_membership_serializer.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

10 lines
215 B
Ruby
Raw Normal View History

DEV: Move `discourse-chat` to the core repo. (#18776) As part of this move, we are also renaming `discourse-chat` to `chat`.
2022-11-02 10:41:30 -03:00
# frozen_string_literal: true
PERF: Stop serializing user in `ChatChannelSerializer#current_user_membership` (#19527) The client already has all the information about the current user so there is no need for us to be serializing the current `User` object each time per channel that is preloaded. In production, profiling shows that this unneeded serializing adds a roughly 5% overhead to a request.
2022-12-22 05:30:06 +08:00
class UserChatChannelMembershipSerializer < BaseChatChannelMembershipSerializer
DEV: Move `discourse-chat` to the core repo. (#18776) As part of this move, we are also renaming `discourse-chat` to `chat`.
2022-11-02 10:41:30 -03:00
has_one :user, serializer: BasicUserSerializer, embed: :objects
def user
object.user
end
end
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 98ms Template: 1ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API