Add tootctl cache recount
command (#11597)
This commit is contained in:
@ -26,7 +26,8 @@ module AccountCounters
|
||||
private
|
||||
|
||||
def save_account_stat
|
||||
return unless account_stat&.changed?
|
||||
return unless association(:account_stat).loaded? && account_stat&.changed?
|
||||
|
||||
account_stat.save
|
||||
end
|
||||
end
|
||||
|
@ -388,13 +388,16 @@ class Status < ApplicationRecord
|
||||
end
|
||||
end
|
||||
|
||||
def status_stat
|
||||
super || build_status_stat
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def update_status_stat!(attrs)
|
||||
return if marked_for_destruction? || destroyed?
|
||||
|
||||
record = status_stat || build_status_stat
|
||||
record.update(attrs)
|
||||
status_stat.update(attrs)
|
||||
end
|
||||
|
||||
def store_uri
|
||||
|
Reference in New Issue
Block a user