Progress on chat

This commit is contained in:
mgabdev
2020-12-22 14:19:38 -05:00
parent 7a62adea3e
commit 4e1e29571b
4 changed files with 17 additions and 6 deletions

View File

@@ -35,6 +35,10 @@ class ChatConversationAccount < ApplicationRecord
belongs_to :chat_conversation
belongs_to :last_chat_message, class_name: 'ChatMessage', optional: true
default_scope { recent }
scope :recent, -> { reorder(updated_at: :desc) }
def participant_accounts
if participant_account_ids.empty?
[account]