diff options
author | Drew Blessing <drew.blessing@buckle.com> | 2013-12-11 09:30:22 -0600 |
---|---|---|
committer | Drew Blessing <drew.blessing@buckle.com> | 2013-12-11 09:30:22 -0600 |
commit | c26d392b1a160ae357a63cf160daeb81a0dd8ece (patch) | |
tree | 79104023aea917518515d66888b477f6e0f03fc9 /app/uploaders | |
parent | 2934e7a9627bb92ab9367923cdbcbaa13f7843d4 (diff) | |
download | gitlab-ce-c26d392b1a160ae357a63cf160daeb81a0dd8ece.tar.gz |
Expire event cache on avatar creation/removal
Diffstat (limited to 'app/uploaders')
-rw-r--r-- | app/uploaders/attachment_uploader.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/uploaders/attachment_uploader.rb b/app/uploaders/attachment_uploader.rb index 98794c9470b..b122b6c8658 100644 --- a/app/uploaders/attachment_uploader.rb +++ b/app/uploaders/attachment_uploader.rb @@ -3,6 +3,8 @@ class AttachmentUploader < CarrierWave::Uploader::Base storage :file + after :store, :reset_events_cache + def store_dir "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}" end @@ -27,4 +29,8 @@ class AttachmentUploader < CarrierWave::Uploader::Base def file_storage? self.class.storage == CarrierWave::Storage::File end + + def reset_events_cache(file) + model.reset_events_cache if model.is_a?(User) + end end |