Module: CacheIt

Defined in:
lib/cache_it.rb,
lib/cache_it/version.rb

Overview

Cache for ActiveRecord objects, backed by ActiveSupport::CacheStore of your choice.

Usage

# migration
create_table :users do |t|
   t.string :first
   t.string :last
   t.string :email
   t.integer :age
   t.integer :points
 end

 class User < ActiveRecord::Base
   cache_it do |c|
     c.index :first, :last
     c.index :email
     c.counters :points
   end
 end

 user = User.cache_it.find(:first => "Joe", :last => "Schmoe")
 user = User.cache_it.find(:email => "[email protected]")
 user.age = 30
 user.cache_it_write

Defined Under Namespace

Classes: ClassDelegate, Config, InstanceDelegate

Constant Summary collapse

VERSION =
"0.0.2"