Sha256: c22512cd34f16ff9436be8fdeb767b7817216e73168a756180854d515efba32e

Contents?: true

Size: 331 Bytes

Versions: 3

Compression:

Stored size: 331 Bytes

Contents

module Persistent
  module Settings
    module Caching
      def cache_key_for(key)
        "settings/#{key}"
      end

      def write_to_cache(key, value)
        ::Rails.cache.write(cache_key_for(key), value)
      end

      def read_from_cache(key)
        ::Rails.cache.fetch(cache_key_for(key))
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
persistent_settings-1.5.0 lib/persistent/settings/caching.rb
persistent_settings-1.4.0 lib/persistent/settings/caching.rb
persistent_settings-1.3.0 lib/persistent/settings/caching.rb