Sha256: 0a7066bd265f5a807a61cb28522fbf97fb7189f3743242f6c31d111cd522de0d
Contents?: true
Size: 833 Bytes
Versions: 23
Compression:
Stored size: 833 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 < Para::ApplicationRecord 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
23 entries across 23 versions & 1 rubygems