module ManageCache::ClassMethods

Public Instance Methods

manage_cache_for(keys_specs={}) click to toggle source
# File lib/manage_cache.rb, line 8
def manage_cache_for(keys_specs={})
  #
  # cache_keys_specs is an Array of Hashes, each specifying one cache_key
  # see prepare_cache_key-method below for options to be used
  #
  cattr_accessor :cache_keys_specs
  self.cache_keys_specs = keys_specs

  before_save    { |record| record.dump_cache! }
  before_destroy { |record| record.dump_cache! }

  include ManageCache::LocalInstanceMethods
end