Module: CacheCleaner::CleanById

Extended by:
ActiveSupport::Concern
Included in:
CacheFinder::Cleaner
Defined in:
lib/cache_finder/cleaner/clean_by_id.rb

Overview

Adding the after_save callback to the model. After saving the method will automatically drop cache by key: [‘Class_name’, id]

Instance Method Summary collapse

Instance Method Details

#drop_cache_by_idObject



15
16
17
# File 'lib/cache_finder/cleaner/clean_by_id.rb', line 15

def drop_cache_by_id
  Rails.cache.delete([self.class.name, self.id])
end