Class: RailsAdserver::AdvertisementUploader
- Inherits:
-
CarrierWave::Uploader::Base
- Object
- CarrierWave::Uploader::Base
- RailsAdserver::AdvertisementUploader
- Defined in:
- app/uploaders/rails_adserver/advertisement_uploader.rb
Instance Method Summary collapse
- #cache_dir ⇒ Object
- #extension_white_list ⇒ Object
-
#store_dir ⇒ Object
Override the directory where uploaded files will be stored.
Instance Method Details
#cache_dir ⇒ Object
24 25 26 |
# File 'app/uploaders/rails_adserver/advertisement_uploader.rb', line 24 def cache_dir "#{Rails.root}/tmp/uploads" end |
#extension_white_list ⇒ Object
20 21 22 |
# File 'app/uploaders/rails_adserver/advertisement_uploader.rb', line 20 def extension_white_list %w(jpg jpeg gif png) end |
#store_dir ⇒ Object
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 |