Class/Module Index [+]

Quicksearch

Sequel::Plugins::Caching::InstanceMethods

Public Instance Methods

before_update() click to toggle source

Remove the object from the cache when updating

# File lib/sequel/plugins/caching.rb, line 114
def before_update
  cache_delete
  super
end
cache_key() click to toggle source

Return a key unique to the underlying record for caching, based on the primary key value(s) for the object. If the model does not have a primary key, raise an Error.

# File lib/sequel/plugins/caching.rb, line 122
def cache_key
  raise(Error, "No primary key is associated with this model") unless key = primary_key
  pk = case key
  when Array
    key.collect{|k| @values[k]}
  else
    @values[key] || (raise Error, 'no primary key for this record')
  end
  model.send(:cache_key, pk)
end
delete() click to toggle source

Remove the object from the cache when deleting

# File lib/sequel/plugins/caching.rb, line 134
def delete
  cache_delete
  super
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.