Class: C80NewsTz::PdfUploader

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

Instance Method Summary collapse

Instance Method Details

#extension_white_listObject



6
7
8
# File 'app/uploaders/c80_news_tz/pdf_uploader.rb', line 6

def extension_white_list
  %w(pdf)
end

#filenameObject



10
11
12
13
14
# File 'app/uploaders/c80_news_tz/pdf_uploader.rb', line 10

def filename
  if original_filename
    "file_#{secure_token(4)}.#{file.extension}"
  end
end

#store_dirObject



16
17
18
# File 'app/uploaders/c80_news_tz/pdf_uploader.rb', line 16

def store_dir
  "uploads/pdfs/#{model.id}"
end