about summary refs log tree commit diff
path: root/app/services/warm_cache_service.rb
blob: 091a471ffa1aa3a7dbfeffc0ed9390f52bc52b2c (plain) (blame)
1
2
3
4
5
6
7
8
# frozen_string_literal: true

class WarmCacheService < BaseService
  def call(cacheable)
    full_item = cacheable.class.where(id: cacheable.id).with_includes.first
    Rails.cache.write(cacheable.cache_key, full_item)
  end
end