Fix full-text search error
This commit is contained in:
parent
df4c4dc80c
commit
d9df73f878
1 changed files with 2 additions and 2 deletions
|
@ -150,8 +150,8 @@ class SearchService < BaseService
|
||||||
def following_account_ids
|
def following_account_ids
|
||||||
return @following_account_ids if defined?(@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
|
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 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 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_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)
|
@following_account_ids = following_accounts.pluck(:target_account_id)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue