Module: Qor::Cache::SingletonMethods

Defined in:
lib/qor_cache/active_record.rb

Instance Method Summary collapse

Instance Method Details

#_qor_cache_expireObject



29
30
31
32
# File 'lib/qor_cache/active_record.rb', line 29

def _qor_cache_expire
  Qor::Cache::Base.cache_store.delete(_qor_cache_key)
  true
end

#_qor_cache_keyObject



16
17
18
# File 'lib/qor_cache/active_record.rb', line 16

def _qor_cache_key
  "#{self.name}-cache_key"
end

#cache_keyObject



20
21
22
23
24
25
26
27
# File 'lib/qor_cache/active_record.rb', line 20

def cache_key
  Qor::Cache::Base.cache_store.fetch(_qor_cache_key) do
    key = self.name.to_s
    key << Time.now.to_i.to_s
    key << rand.to_s
    Digest::SHA1.hexdigest(key)
  end
end