Add AccountStat.by_recent_status
, use in Account
(#29704)
This commit is contained in:
parent
b34c089591
commit
cf76380c91
3 changed files with 6 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue