Class: Locomotive::PictureUploader

Inherits:
BaseUploader show all
Defined in:
app/uploaders/locomotive/picture_uploader.rb

Instance Method Summary collapse

Methods inherited from CarrierWave::Uploader::Base

#build_store_dir, #to_label, #to_liquid

Methods included from CarrierWave::Uploader::Base64Download

#download!

Instance Method Details

#extension_whitelistObject


6
7
8
# File 'app/uploaders/locomotive/picture_uploader.rb', line 6

def extension_whitelist
  %w(jpg jpeg gif png)
end

#image?Boolean

Returns:


10
11
12
# File 'app/uploaders/locomotive/picture_uploader.rb', line 10

def image?
  self.file.try(:exists?)
end

#store_dirObject


14
15
16
# File 'app/uploaders/locomotive/picture_uploader.rb', line 14

def store_dir
  self.build_store_dir('uploaded_assets', model.id)
end