Sha256: 01a1466d3898e23b4f52605b812454a6641d7a8757a173ce4c9e6b91a2c65a5a
Contents?: true
Size: 475 Bytes
Versions: 40
Compression:
Stored size: 475 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
40 entries across 40 versions & 1 rubygems