123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- class AvatarUploader < CarrierWave::Uploader::Base
-
-
- include CarrierWave::MiniMagick
- include CarrierWave::MimeTypes
-
- include ::CarrierWave::Backgrounder::Delay
-
-
- if Rails.env.test? or Rails.env.cucumber?
- storage :file
- end
- if Rails.env.development?
- storage :file
- end
- if Rails.env.production?
-
-
- include Sprockets::Helpers
- storage :fog
- end
-
- process :set_content_type
-
-
- def store_dir
- "uploads/#{mounted_as}/#{model.id}"
- end
-
- def root
- "#{Rails.root}/public"
- end
-
- def cache_dir
- " ./tmp/uploads/#{mounted_as}/"
- end
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- version :thumb do
- process :resize_to_fit => [50, 50]
- end
-
-
-
-
-
-
-
-
-
-
- end
|