Fix /api/v1/conversations sometimes returning empty accounts (#25499)
This commit is contained in:
parent
ec91ea4457
commit
ebfeaebedb
2 changed files with 6 additions and 10 deletions
|
@ -32,14 +32,8 @@ class AccountConversation < ApplicationRecord
|
|||
end
|
||||
|
||||
def participant_accounts
|
||||
@participant_accounts ||= begin
|
||||
if participant_account_ids.empty?
|
||||
[account]
|
||||
else
|
||||
participants = Account.where(id: participant_account_ids).to_a
|
||||
participants.empty? ? [account] : participants
|
||||
end
|
||||
end
|
||||
@participant_accounts ||= Account.where(id: participant_account_ids).to_a
|
||||
@participant_accounts.presence || [account]
|
||||
end
|
||||
|
||||
class << self
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue