Class: C80NewsTz::FphotoUploader

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

Instance Method Summary collapse

Instance Method Details

#extension_white_listObject



42
43
44
# File 'app/uploaders/c80_news_tz/fphoto_uploader.rb', line 42

def extension_white_list
  %w(jpg jpeg gif png)
end

#filenameObject



46
47
48
49
50
# File 'app/uploaders/c80_news_tz/fphoto_uploader.rb', line 46

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

#store_dirObject



38
39
40
# File 'app/uploaders/c80_news_tz/fphoto_uploader.rb', line 38

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