Add removing referred status count

This commit is contained in:
KMY 2023-07-06 18:11:13 +09:00
parent 801d17f34d
commit 3cb89c592f

View file

@ -45,6 +45,7 @@ class RemoveStatusService < BaseService
remove_from_public
remove_from_media if @status.with_media?
remove_media
decrement_references
end
@status.destroy! if permanently?
@ -117,6 +118,12 @@ class RemoveStatusService < BaseService
end
end
def decrement_references
@status.references.each do |ref|
ref.decrement_count!(:status_referred_by_count)
end
end
def remove_from_hashtags
@account.featured_tags.where(tag_id: @status.tags.map(&:id)).each do |featured_tag|
featured_tag.decrement(@status.id)