Sha256: 3185a9752bf64a78ed598fc8d5094ab613cb145d3e8b026abbe1e4eef1616551
Contents?: true
Size: 828 Bytes
Versions: 25
Compression:
Stored size: 828 Bytes
Contents
# Borrowed from activesupport-db-cache gem (https://github.com/sergio-fry/activesupport-db-cache), # which is out of date now not allowing us to depend on it in para # module Para module Cache class Item < ActiveRecord::Base def value Marshal.load(::Base64.decode64(self[:value])) if self[:value].present? end def value=(new_value) @raw_value = new_value self[:value] = ::Base64.encode64(Marshal.dump(@raw_value)) end def expired? read_attribute(:expires_at).try(:past?) || false end def mismatched?(_version = nil) false end # From ActiveSupport::Cache::Store::Entry # Seconds since the epoch when the entry will expire. def expires_at read_attribute(:expires_at).try(:to_f) end end end end
Version data entries
25 entries across 25 versions & 1 rubygems