Sha256: 60b538e085dd0e1c6cac75e63a326b7ee1318efe645c3091be414b5d443131a7
Contents?: true
Size: 439 Bytes
Versions: 38
Compression:
Stored size: 439 Bytes
Contents
module Alchemy module Picture::Sweeping extend ActiveSupport::Concern included do after_update { expire_cache_for(self) } after_destroy { expire_cache_for(self) } end private # Removing all variants of the picture with FileUtils. def expire_cache_for(picture) FileUtils.rm_rf(Rails.root.join('public', Alchemy::MountPoint.get.gsub(/^\//, ''), 'pictures', picture.id.to_s)) end end end
Version data entries
38 entries across 38 versions & 2 rubygems