From 1134871cbcdbf58ab613509d83e5d56a6863ab7d Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Thu, 20 Mar 2025 11:03:17 +0530 Subject: [PATCH] chore: add comments --- app/services/search_service.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/services/search_service.rb b/app/services/search_service.rb index 3c9876c41..524b5fc23 100644 --- a/app/services/search_service.rb +++ b/app/services/search_service.rb @@ -26,6 +26,7 @@ class SearchService def filter_conversations query = current_account.conversations + # admins can see all conversations anyway, so no need to add the heavy IN clause query = query.where(inbox_id: accessable_inbox_ids) unless @current_account_user.administrator? @conversations = query.joins('INNER JOIN contacts ON conversations.contact_id = contacts.id') @@ -70,6 +71,7 @@ class SearchService def message_base_query query = current_account.messages + # admins can see all conversations anyway, so no need to add the heavy IN clause query = query.where(inbox_id: accessable_inbox_ids) unless @current_account_user.administrator? query.where('created_at >= ?', 3.months.ago) end