Use cache money only for a single model?
问题 I want to use cache-money but I don't want to start automatically caching everything (I'm working with a large production app, terabytes of data etc). How do I use it for only the models that I specify? Right now I've got: # initializers/cache_money.rb require 'cache_money' config = (cfg = YAML.load(IO.read(File.join(RAILS_ROOT, "config", "memcached.yml"))))[RAILS_ENV] || cfg["defaults"] $memcache = MemCache.new(config) $memcache.servers = config['servers'] $local = Cash::Local.new($memcache)