mirror of
https://github.com/discourse/discourse.git
synced 2025-05-25 09:57:25 +08:00
29 lines
661 B
Ruby
29 lines
661 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Chat
|
|
class MessageReaction < ActiveRecord::Base
|
|
self.table_name = "chat_message_reactions"
|
|
|
|
belongs_to :chat_message, class_name: "Chat::Message"
|
|
belongs_to :user
|
|
|
|
validates :emoji, length: { maximum: 100 }
|
|
end
|
|
end
|
|
|
|
# == Schema Information
|
|
#
|
|
# Table name: chat_message_reactions
|
|
#
|
|
# id :bigint not null, primary key
|
|
# chat_message_id :integer
|
|
# user_id :integer
|
|
# emoji :string
|
|
# created_at :datetime not null
|
|
# updated_at :datetime not null
|
|
#
|
|
# Indexes
|
|
#
|
|
# chat_message_reactions_index (chat_message_id,user_id,emoji) UNIQUE
|
|
#
|