Sha256: ce6d59aacfffd9d4ea938d67d406fa9f18858baea4ee9a045db8bf5f1e654abe
Contents?: true
Size: 532 Bytes
Versions: 14
Compression:
Stored size: 532 Bytes
Contents
class PicturesSweeper < ActionController::Caching::Sweeper observe 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}/public/pictures/show/#{picture.id}") FileUtils.rm_rf("#{Rails.root}/public/pictures/thumbnails/#{picture.id}") expire_page(zoom_picture_path(picture, :format => 'png')) end end
Version data entries
14 entries across 14 versions & 1 rubygems