mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 21:55:25 +08:00
DEV: Rename direct message related models
This is a followup of the previous refactor where we created two new models to handle all the dedicated logic that was present in the `ChatChannel` model. For the sake of consistency, `DMChannel` has been renamed to `DirectMessageChannel` and the previous `DirectMessageChannel` model is now named `DirectMessage`. This should help reasoning about direct messages.
This commit is contained in:

committed by
Loïc Guitaut

parent
7e992cb299
commit
abcaa1a961
@ -44,8 +44,8 @@ class ChatChannelSerializer < ApplicationSerializer
|
||||
case object.chatable_type
|
||||
when "Category"
|
||||
BasicCategorySerializer.new(object.chatable, root: false).as_json
|
||||
when "DirectMessageChannel"
|
||||
DirectMessageChannelSerializer.new(object.chatable, scope: scope, root: false).as_json
|
||||
when "DirectMessage"
|
||||
DirectMessageSerializer.new(object.chatable, scope: scope, root: false).as_json
|
||||
when "Site"
|
||||
nil
|
||||
end
|
||||
|
@ -1,6 +1,6 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class DirectMessageChannelSerializer < ApplicationSerializer
|
||||
class DirectMessageSerializer < ApplicationSerializer
|
||||
has_many :users, serializer: UserWithCustomFieldsAndStatusSerializer, embed: :objects
|
||||
|
||||
def users
|
Reference in New Issue
Block a user