Class: C80NewsTz::CphotoUploader

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

Instance Method Summary collapse

Instance Method Details

#extension_white_listObject



28
29
30
# File 'app/uploaders/c80_news_tz/cphoto_uploader.rb', line 28

def extension_white_list
  %w(jpg jpeg gif png)
end

#filenameObject



32
33
34
35
36
# File 'app/uploaders/c80_news_tz/cphoto_uploader.rb', line 32

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

#store_dirObject



24
25
26
# File 'app/uploaders/c80_news_tz/cphoto_uploader.rb', line 24

def store_dir
  "uploads/companies/#{format("%02d", model.company_id)}"
end