Merge branch 'main' into glitch-soc/merge-upstream
Conflicts: - `config/environments/production.rb`: Upstream changed headers, and we have different ones. Ported upstream's change.
This commit is contained in:
@ -511,7 +511,8 @@ class Account < ApplicationRecord
|
||||
<<-SQL.squish
|
||||
SELECT
|
||||
accounts.*,
|
||||
(count(f.id) + 1) * #{BOOST} * ts_rank_cd(#{TEXTSEARCH}, to_tsquery('simple', :tsquery), 32) AS rank
|
||||
#{BOOST} * ts_rank_cd(#{TEXTSEARCH}, to_tsquery('simple', :tsquery), 32) AS rank,
|
||||
count(f.id) AS followed
|
||||
FROM accounts
|
||||
LEFT OUTER JOIN follows AS f ON (accounts.id = f.account_id AND f.target_account_id = :id) OR (accounts.id = f.target_account_id AND f.account_id = :id)
|
||||
LEFT JOIN users ON accounts.id = users.account_id
|
||||
@ -521,7 +522,7 @@ class Account < ApplicationRecord
|
||||
AND accounts.moved_to_account_id IS NULL
|
||||
AND (accounts.domain IS NOT NULL OR (users.approved = TRUE AND users.confirmed_at IS NOT NULL))
|
||||
GROUP BY accounts.id, s.id
|
||||
ORDER BY rank DESC
|
||||
ORDER BY followed DESC, rank DESC
|
||||
LIMIT :limit OFFSET :offset
|
||||
SQL
|
||||
end
|
||||
|
Reference in New Issue
Block a user