Unuse ActiveRecord::Base#cache_key (#8185)
* Unuse ActiveRecord::Base#cache_key * Enable cache_versioning * Call cache_collection
This commit is contained in:
parent
0d1d9b9a33
commit
9e75aa30cd
6 changed files with 9 additions and 17 deletions
|
@ -17,8 +17,7 @@ class Api::V1::StatusesController < Api::BaseController
|
|||
CONTEXT_LIMIT = 4_096
|
||||
|
||||
def show
|
||||
cached = Rails.cache.read(@status.cache_key)
|
||||
@status = cached unless cached.nil?
|
||||
@status = cache_collection([@status], Status).first
|
||||
render json: @status, serializer: REST::StatusSerializer
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue