Class: C80NewsTz::GphotoUploader

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

Instance Method Summary collapse

Instance Method Details

#filenameObject



44
45
46
47
48
# File 'app/uploaders/c80_news_tz/gphoto_uploader.rb', line 44

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

#store_dirObject



8
9
10
# File 'app/uploaders/c80_news_tz/gphoto_uploader.rb', line 8

def store_dir
  "uploads/gallery/#{format("%03d", model.gallery_id)}"
end