Rename cache_*
methods to preload_*
in controller concern (#30209)
This commit is contained in:
parent
f0d6dc4519
commit
65e82211cd
19 changed files with 56 additions and 54 deletions
|
@ -45,20 +45,4 @@ module CacheConcern
|
|||
Rails.cache.write(key, response.body, expires_in: expires_in, raw: true)
|
||||
end
|
||||
end
|
||||
|
||||
# TODO: Rename this method, as it does not perform any caching anymore.
|
||||
def cache_collection(raw, klass)
|
||||
return raw unless klass.respond_to?(:preload_cacheable_associations)
|
||||
|
||||
records = raw.to_a
|
||||
|
||||
klass.preload_cacheable_associations(records)
|
||||
|
||||
records
|
||||
end
|
||||
|
||||
# TODO: Rename this method, as it does not perform any caching anymore.
|
||||
def cache_collection_paginated_by_id(raw, klass, limit, options)
|
||||
cache_collection raw.to_a_paginated_by_id(limit, options), klass
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue