public
Description: automatically cache ActiveRecord associations
Clone URL: git://github.com/grantr/cached_associations.git
Search Repo:
name age message
folder .gitignore Sun May 04 22:22:33 -0700 2008 oops, remove swp file [grantr]
folder MIT-LICENSE Sun May 04 22:15:17 -0700 2008 initial commit [grantr]
folder README Sun May 04 22:15:17 -0700 2008 initial commit [grantr]
folder Rakefile Sun May 04 22:15:17 -0700 2008 initial commit [grantr]
folder init.rb Sun May 04 22:15:17 -0700 2008 initial commit [grantr]
folder install.rb Sun May 04 22:15:17 -0700 2008 initial commit [grantr]
folder lib/ Sun May 11 00:40:42 -0700 2008 basic has_many_cached [grantr]
folder tasks/ Sun May 04 22:15:17 -0700 2008 initial commit [grantr]
folder test/ Sun May 04 22:15:17 -0700 2008 initial commit [grantr]
folder uninstall.rb Sun May 04 22:15:17 -0700 2008 initial commit [grantr]
README
Automatically cache ActiveRecord associations in memcached.

class User < ActiveRecord::Base
  acts_as_cached
  belongs_to_cached :group
end

class Group < ActiveRecord::Base
  acts_as_cached
end

Instead of caching the association objects and writing expiration sweepers,
we cache the association ids and load the objects from memcached by id.

cache_fu is required (for now)