Progress on dms, code cleanup

Progress on dms, code cleanup
This commit is contained in:
mgabdev
2020-12-02 23:22:51 -05:00
parent 20d4fc09af
commit 9a43c51085
103 changed files with 3656 additions and 859 deletions

View File

@@ -0,0 +1,27 @@
# frozen_string_literal: true
# == Schema Information
#
# Table name: chat_messages
#
# id :bigint(8) not null, primary key
# account_id :bigint(8) not null
# chat_conversation_id :bigint(8) not null
# text :text default(""), not null
# language :string
# created_at :datetime not null
# updated_at :datetime not null
#
class ChatMessage < ApplicationRecord
include Paginable
belongs_to :from_account, class_name: 'Account'
belongs_to :chat_conversation
validates_with ChatMessageLengthValidator
default_scope { recent }
scope :recent, -> { reorder(created_at: :desc) }
end