Add AnnualReport::Source#report_statuses method for subclasses to use (#31753)

This commit is contained in:
Matt Jankowski 2024-09-04 15:50:33 -04:00 committed by GitHub
parent 559958f8c5
commit 4678473e54
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 22 additions and 25 deletions

View file

@ -17,6 +17,6 @@ class AnnualReport::CommonlyInteractedWithAccounts < AnnualReport::Source
private
def commonly_interacted_with_accounts
@account.statuses.reorder(nil).where(id: year_as_snowflake_range).where.not(in_reply_to_account_id: @account.id).group(:in_reply_to_account_id).having('count(*) > 1').order(total: :desc).limit(SET_SIZE).pluck(Arel.sql('in_reply_to_account_id, count(*) AS total'))
report_statuses.where.not(in_reply_to_account_id: @account.id).group(:in_reply_to_account_id).having('count(*) > 1').order(total: :desc).limit(SET_SIZE).pluck(Arel.sql('in_reply_to_account_id, count(*) AS total'))
end
end