Module: Sequel::Plugins::Caching::InstanceMethods
- Defined in:
- lib/sequel/plugins/caching.rb
Instance Method Summary collapse
- 
  
    
      #before_update  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Remove the object from the cache when updating. 
- 
  
    
      #cache_key  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Return a key unique to the underlying record for caching, based on the primary key value(s) for the object. 
- 
  
    
      #delete  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Remove the object from the cache when deleting. 
Instance Method Details
#before_update ⇒ Object
Remove the object from the cache when updating
| 137 138 139 140 | # File 'lib/sequel/plugins/caching.rb', line 137 def before_update cache_delete super end | 
#cache_key ⇒ Object
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.
| 145 146 147 | # File 'lib/sequel/plugins/caching.rb', line 145 def cache_key model.cache_key(pk) end | 
#delete ⇒ Object
Remove the object from the cache when deleting
| 150 151 152 153 | # File 'lib/sequel/plugins/caching.rb', line 150 def delete cache_delete super end |