Class: Spina::PhotoUploader
- Inherits:
-
CarrierWave::Uploader::Base
- Object
- CarrierWave::Uploader::Base
- Spina::PhotoUploader
- Includes:
- CarrierWave::MiniMagick
- Defined in:
- app/uploaders/spina/photo_uploader.rb
Instance Method Summary collapse
Instance Method Details
#extension_white_list ⇒ Object
27 28 29 |
# File 'app/uploaders/spina/photo_uploader.rb', line 27 def extension_white_list %w(jpg jpeg gif png) end |
#store_dir ⇒ Object
7 8 9 10 11 12 13 |
# File 'app/uploaders/spina/photo_uploader.rb', line 7 def store_dir if Engine.config.storage == :s3 "#{mounted_as}/#{model.id}" else "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}" end end |
#too_large?(new_file) ⇒ Boolean
23 24 25 |
# File 'app/uploaders/spina/photo_uploader.rb', line 23 def too_large?(new_file) new_file.size > 120 * 1000 end |