module ActiveModel::Serializer::Caching::ClassMethods

def cache_store

Returns:
  • (nil) - when _cache is the NullStore and ActiveModelSerializers.config.cache_store is nil.
  • (ActiveModelSerializers.config.cache_store) - when _cache is the NullStore.
  • (._cache) - when _cache is not the NullStore
  • (nil) - when _cache is not set (i.e. when `cache` has not been called)
def cache_store
  return nil if _cache.nil?
  return _cache if _cache.class != ActiveSupport::Cache::NullStore
  if ActiveModelSerializers.config.cache_store
    self._cache = ActiveModelSerializers.config.cache_store
  else
    nil
  end
end