Module: SmartCollection::Mixin::InstanceMethods

Defined in:
lib/smart_collection/mixin.rb

Instance Method Summary collapse

Instance Method Details

#cache_exists?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/smart_collection/mixin.rb', line 12

def cache_exists?
  smart_collection_mixin.config.cache_manager.cache_exists? self
end

#expire_cacheObject



8
9
10
# File 'lib/smart_collection/mixin.rb', line 8

def expire_cache
  update_column(:cache_expires_at, nil)
end

#smart_collection_mixinObject



16
17
18
# File 'lib/smart_collection/mixin.rb', line 16

def smart_collection_mixin
  self.class.smart_collection_mixin
end

#update_cacheObject



4
5
6
# File 'lib/smart_collection/mixin.rb', line 4

def update_cache
  smart_collection_mixin.config.cache_manager.update self
end