diff options
author | abcang <abcang1015@gmail.com> | 2018-08-19 22:52:38 +0900 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2018-08-19 15:52:38 +0200 |
commit | 9e75aa30cd229c45fd95e00a93416221c83a4fd7 (patch) | |
tree | a0a5d6583f662e60e09466d2fb093bcbdbbfad56 /app/controllers/api/v1 | |
parent | 0d1d9b9a33149adbcdd063177eae9944462c91ff (diff) |
Unuse ActiveRecord::Base#cache_key (#8185)
* Unuse ActiveRecord::Base#cache_key * Enable cache_versioning * Call cache_collection
Diffstat (limited to 'app/controllers/api/v1')
-rw-r--r-- | app/controllers/api/v1/statuses_controller.rb | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/app/controllers/api/v1/statuses_controller.rb b/app/controllers/api/v1/statuses_controller.rb index c6925d462..49a52f7a6 100644 --- a/app/controllers/api/v1/statuses_controller.rb +++ b/app/controllers/api/v1/statuses_controller.rb @@ -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 |