From d9df73f878c85a9015f0e33d3c19697cda7416b8 Mon Sep 17 00:00:00 2001 From: KMY Date: Tue, 23 May 2023 08:22:59 +0900 Subject: [PATCH] Fix full-text search error --- app/services/search_service.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/services/search_service.rb b/app/services/search_service.rb index 9901a23c50..c0101c9b05 100644 --- a/app/services/search_service.rb +++ b/app/services/search_service.rb @@ -150,8 +150,8 @@ class SearchService < BaseService def following_account_ids return @following_account_ids if defined?(@following_account_ids) - account_exists_sql = Account.where('accounts.id = follows.target_account_id').where(searchability: %w(public unlisted private)).reorder(nil).select(1).to_sql - status_exists_sql = Status.where('statuses.account_id = follows.target_account_id').where(reblog_of_id: nil).where(searchability: %w(public unlisted private)).reorder(nil).select(1).to_sql + account_exists_sql = Account.where('accounts.id = follows.target_account_id').where(searchability: %w(public private)).reorder(nil).select(1).to_sql + status_exists_sql = Status.where('statuses.account_id = follows.target_account_id').where(reblog_of_id: nil).where(searchability: %w(public private)).reorder(nil).select(1).to_sql following_accounts = Follow.where(account_id: @account.id).merge(Account.where("EXISTS (#{account_exists_sql})").or(Account.where("EXISTS (#{status_exists_sql})"))) @following_account_ids = following_accounts.pluck(:target_account_id) end