0
0
Fork 0

Add AccountStat.by_recent_status, use in Account (#29704)

This commit is contained in:
Matt Jankowski 2024-03-26 09:12:09 -04:00 committed by GitHub
parent b34c089591
commit cf76380c91
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 2 deletions

View file

@ -20,6 +20,9 @@ class AccountStat < ApplicationRecord
belongs_to :account, inverse_of: :account_stat
scope :by_recent_status, -> { order(arel_table[:last_status_at].desc.nulls_last) }
scope :without_recent_activity, -> { where(last_status_at: [nil, ...1.month.ago]) }
update_index('accounts', :account)
def following_count