mirror of
https://github.com/discourse/discourse.git
synced 2024-12-05 09:13:43 +08:00
abcaa1a961
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.
22 lines
616 B
Ruby
22 lines
616 B
Ruby
# frozen_string_literal: true
|
|
|
|
class DirectMessageUser < ActiveRecord::Base
|
|
belongs_to :direct_message, foreign_key: :direct_message_channel_id
|
|
belongs_to :user
|
|
end
|
|
|
|
# == Schema Information
|
|
#
|
|
# Table name: direct_message_users
|
|
#
|
|
# id :bigint not null, primary key
|
|
# direct_message_channel_id :integer not null
|
|
# user_id :integer not null
|
|
# created_at :datetime not null
|
|
# updated_at :datetime not null
|
|
#
|
|
# Indexes
|
|
#
|
|
# direct_message_users_index (direct_message_channel_id,user_id) UNIQUE
|
|
#
|