discourse/plugins/chat/app/models/chat/message_revision.rb
David Battersby 16ccf30abc
DEV: add maxlength limits to chat messages and revisions (#23530)
Add additional limits to text columns for chat.
2023-09-12 18:02:04 +08:00

32 lines
869 B
Ruby

# frozen_string_literal: true
module Chat
class MessageRevision < ActiveRecord::Base
self.table_name = "chat_message_revisions"
validates :old_message, length: { maximum: 50_000 }
validates :new_message, length: { maximum: 50_000 }
belongs_to :chat_message, class_name: "Chat::Message"
belongs_to :user
end
end
# == Schema Information
#
# Table name: chat_message_revisions
#
# id :bigint not null, primary key
# chat_message_id :integer
# old_message :text not null
# new_message :text not null
# created_at :datetime not null
# updated_at :datetime not null
# user_id :integer not null
#
# Indexes
#
# index_chat_message_revisions_on_chat_message_id (chat_message_id)
# index_chat_message_revisions_on_user_id (user_id)
#