mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 02:41:13 +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
@ -11,7 +11,7 @@ module DiscourseDev
|
||||
|
||||
def data
|
||||
if Faker::Boolean.boolean(true_ratio: 0.5)
|
||||
channel = ::ChatChannel.where(chatable_type: "DirectMessageChannel").order("RANDOM()").first
|
||||
channel = ::ChatChannel.where(chatable_type: "DirectMessage").order("RANDOM()").first
|
||||
channel.user_chat_channel_memberships.update_all(following: true)
|
||||
user = channel.chatable.users.order("RANDOM()").first
|
||||
else
|
||||
|
Reference in New Issue
Block a user