blob: 6135c3ad96f4e5c3916f426d08cc177880829a2a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
# encoding: utf-8
class AvatarUploader < CarrierWave::Uploader::Base
include UploaderHelper
storage :file
after :store, :reset_events_cache
def store_dir
"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end
def reset_events_cache(file)
model.reset_events_cache if model.is_a?(User)
end
end
|