Chore: Fix N+1 queries in dashboard side (#1254)

* Chore: Fix N+1 queries in dashboard side

Fixed a couple of N+1 queries fired on the dashboard side of
the app to improve performance.
This commit is contained in:
Sony Mathew
2020-09-19 12:46:34 +05:30
committed by GitHub
parent 74d07c876e
commit fc7b84d612
5 changed files with 6 additions and 6 deletions

View File

@@ -62,7 +62,7 @@ class ConversationFinder
def find_all_conversations
@conversations = current_account.conversations.includes(
:assignee, :inbox, contact: [:avatar_attachment]
:assignee, :inbox, :taggings, contact: [:avatar_attachment]
).where(inbox_id: @inbox_ids)
end

View File

@@ -11,7 +11,7 @@ class MessageFinder
private
def conversation_messages
@conversation.messages.includes(:attachments, user: { avatar_attachment: :blob })
@conversation.messages.includes(:attachments, :sender)
end
def messages