Merge branch 'master' into glitch-soc/merge-upstream

This commit is contained in:
Thibaut Girka
2019-11-23 19:03:01 +01:00
10 changed files with 36 additions and 18 deletions

View File

@@ -438,7 +438,7 @@ class Account < ApplicationRecord
accounts.*,
(count(f.id) + 1) * ts_rank_cd(#{textsearch}, #{query}, 32) AS rank
FROM accounts
LEFT OUTER JOIN follows AS f ON (accounts.id = f.account_id AND f.target_account_id = ?) OR (accounts.id = f.target_account_id AND f.account_id = ?)
LEFT OUTER JOIN follows AS f ON (accounts.id = f.account_id AND f.target_account_id = ?)
WHERE accounts.id IN (SELECT * FROM first_degree)
AND #{query} @@ #{textsearch}
AND accounts.suspended_at IS NULL
@@ -448,7 +448,7 @@ class Account < ApplicationRecord
LIMIT ? OFFSET ?
SQL
records = find_by_sql([sql, account.id, account.id, account.id, account.id, limit, offset])
records = find_by_sql([sql, account.id, account.id, account.id, limit, offset])
else
sql = <<-SQL.squish
SELECT