module Scrivito module Cache class FileStore include Chainable attr_reader :internal_store, :next_store def initialize(options = {}) @internal_store = ActiveSupport::Cache::FileStore.new( options[:path] || Rails.root + 'tmp/scrivito_cache') @next_store = options[:next_store] end delegate :clear, to: :internal_store private delegate :read, :write, to: :internal_store, prefix: :internal def transform_key(key) # Workaround for rails/rails#15616. Will be fixed in Rails 4.2. Digest::SHA1.hexdigest(key) end end end end