Class: Vouchers::PhotoUploader

Inherits:
CarrierWave::Uploader::Base
  • Object
show all
Defined in:
app/uploaders/vouchers/photo_uploader.rb

Instance Method Summary collapse

Instance Method Details

#cache_dirObject



27
28
29
# File 'app/uploaders/vouchers/photo_uploader.rb', line 27

def cache_dir
  "system/uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end

#extension_white_listObject



5
6
7
# File 'app/uploaders/vouchers/photo_uploader.rb', line 5

def extension_white_list
  %w(jpg jpeg gif png)
end

#store_dirObject

Override the directory where uploaded files will be stored. This is a sensible default for uploaders that are meant to be mounted:



23
24
25
# File 'app/uploaders/vouchers/photo_uploader.rb', line 23

def store_dir
  "system/uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end