Class: ImageUploader
- Inherits:
-
CarrierWave::Uploader::Base
- Object
- CarrierWave::Uploader::Base
- ImageUploader
show all
- Includes:
- CarrierWave::RMagick
- Defined in:
- app/uploaders/image_uploader.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.choose_storage ⇒ Object
10
11
12
|
# File 'app/uploaders/image_uploader.rb', line 10
def self.choose_storage
(Rails.env.production? and Configuration[:aws_access_key]) ? :fog : :file
end
|
Instance Method Details
#cache_dir ⇒ Object
20
21
22
|
# File 'app/uploaders/image_uploader.rb', line 20
def cache_dir
"#{Rails.root}/tmp/uploads"
end
|
#extension_white_list ⇒ Object
6
7
8
|
# File 'app/uploaders/image_uploader.rb', line 6
def extension_white_list
%w(jpg jpeg gif png) unless mounted_as == :video_thumbnail
end
|
#store_dir ⇒ Object
16
17
18
|
# File 'app/uploaders/image_uploader.rb', line 16
def store_dir
"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end
|