Sha256: fcbda108bccd325966bfed32127d844536bc09819fe7e521b060baadfaeccdf8
Contents?: true
Size: 444 Bytes
Versions: 19
Compression:
Stored size: 444 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.mount_point, 'pictures', picture.id.to_s)) end end end
Version data entries
19 entries across 19 versions & 1 rubygems