Skip to content

Commit

Permalink
added distinct
Browse files Browse the repository at this point in the history
  • Loading branch information
jderecho committed Apr 1, 2024
1 parent 6d75c3c commit e80e0f6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/digitaltolk/close_resolved_conversation_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ def conversations
end

def chat_conversations
conversations.joins(:inbox).where(inboxes: { channel_type: 'Channel::WebWidget'})
conversations.distinct.joins(:inbox).where(inboxes: { channel_type: 'Channel::WebWidget'})
.where.not(messages: { created_at: chat_span })
.limit(50)
end

def email_conversations
conversations.joins(:inbox).where(inboxes: { channel_type: 'Channel::Email'})
conversations.distinct.joins(:inbox).where(inboxes: { channel_type: 'Channel::Email'})
.where.not(messages: { created_at: email_span })
.limit(50)
end
Expand Down

0 comments on commit e80e0f6

Please sign in to comment.