Class Merb::Cache::DatabaseStore::ActiveRecord::CacheModel
In: lib/merb-cache/cache-store/database-activerecord.rb
Parent: ActiveRecord::Base

The cache model

Methods

Public Class methods

Fetch data from the database using the specified key The entry is deleted if it has expired

Parameter

key<Sting>:The key identifying the cache entry

Returns

data<String, NilClass>:nil is returned whether the entry expired or was not found

Store data to the database using the specified key

Parameters

key<Sting>:The key identifying the cache entry
data<String>:The data to be put in cache
expire<~minutes>:The number of minutes (from now) the cache should persist
get<Boolean>:used internally to behave like this
  • when set to true, perform update_or_create on the cache entry
  • when set to false, force creation of the cache entry

Perform auto-migration in case the table is unknown in the database

Expire the cache entry identified by the given key

Parameter

key<Sting>:The key identifying the cache entry

Expire all the cache entries

Expire the cache entries matching the given key

Parameter

key<Sting>:The key matching the cache entries

[Validate]