Class: RailsAdserver::AdvertisementUploader

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

Instance Method Summary collapse

Instance Method Details

#cache_dirObject



24
25
26
# File 'app/uploaders/rails_adserver/advertisement_uploader.rb', line 24

def cache_dir
  "#{Rails.root}/tmp/uploads"
end

#extension_white_listObject



20
21
22
# File 'app/uploaders/rails_adserver/advertisement_uploader.rb', line 20

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:



17
18
19
# File 'app/uploaders/rails_adserver/advertisement_uploader.rb', line 17

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