2a34255e0b
Co-authored-by: Subin <subinthattaparambil@gmail.com> Co-authored-by: Manoj <manojmj92@gmail.com> Co-authored-by: Nithin <webofnithin@gmail.com>
20 lines
448 B
Ruby
20 lines
448 B
Ruby
class AvatarUploader < CarrierWave::Uploader::Base
|
|
include CarrierWave::MiniMagick
|
|
|
|
def store_dir
|
|
if Rails.env.test?
|
|
"#{Rails.root}/spec/support/uploads/avatar/#{model.class.to_s.underscore}/#{model.id}"
|
|
else
|
|
"uploads/avatar/#{model.class.to_s.underscore}/#{model.id}"
|
|
end
|
|
end
|
|
|
|
version :thumb do
|
|
process resize_to_fill: [64,64]
|
|
end
|
|
|
|
version :profile_thumb do
|
|
process resize_to_fill: [128,128]
|
|
end
|
|
|
|
end
|