Cache status reference mark when posting

This commit is contained in:
KMY 2023-09-15 12:21:41 +09:00
parent d8ebc66709
commit 71c451a569
6 changed files with 27 additions and 2 deletions

View file

@ -103,7 +103,9 @@ class REST::StatusSerializer < ActiveModel::Serializer
end
def status_references_count
status_reference_ids.size
return status_reference_ids.size if status_reference_ids.any?
Rails.cache.exist?("status_reference:#{object.id}") ? 1 : 0
end
def reblogs_count