Sha256: 5a3546047229570ca7108571e9f195dec20422ce0f0c42a6f57d68dd07088b4b
Contents?: true
Size: 479 Bytes
Versions: 14
Compression:
Stored size: 479 Bytes
Contents
module Alchemy class PicturesSweeper < ActionController::Caching::Sweeper observe Alchemy::Picture def after_update(picture) expire_cache_for(picture) end def after_destroy(picture) expire_cache_for(picture) end private def expire_cache_for(picture) # Removing all variants of the picture with FileUtils. FileUtils.rm_rf(Rails.root.join('public', Alchemy::MountPoint.get, 'pictures', picture.id.to_s)) end end end
Version data entries
14 entries across 14 versions & 1 rubygems