12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- class CoverUploader < 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 => [300, 200]
- end
-
- version :mini do
- process :resize_to_fit => [150, 100]
- end
-
-
-
-
-
-
-
-
-
-
- end
|