Cache status reference mark when posting
This commit is contained in:
parent
d8ebc66709
commit
71c451a569
6 changed files with 27 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue