Class: C80NewsTz::Bimage02Uploader

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

Instance Method Summary collapse

Instance Method Details

#extension_white_listObject



27
28
29
# File 'app/uploaders/c80_news_tz/bimage02_uploader.rb', line 27

def extension_white_list
  %w(jpg jpeg gif png)
end

#filenameObject



31
32
33
34
35
# File 'app/uploaders/c80_news_tz/bimage02_uploader.rb', line 31

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

#store_dirObject



23
24
25
# File 'app/uploaders/c80_news_tz/bimage02_uploader.rb', line 23

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