Class: C80NewsTz::RBphotoUploader

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

Instance Method Summary collapse

Instance Method Details

#extension_white_listObject



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

def extension_white_list
  %w(jpg jpeg gif png)
end

#filenameObject



42
43
44
45
46
# File 'app/uploaders/c80_news_tz/r_bphoto_uploader.rb', line 42

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

#store_dirObject



34
35
36
# File 'app/uploaders/c80_news_tz/r_bphoto_uploader.rb', line 34

def store_dir
  "uploads/rec/blurbs/#{format("%02d", model.r_blurb_id)}"
end