Class: PhotoUploader

Inherits:
CarrierWave::Uploader::Base
  • Object
show all
Includes:
CarrierWave::BombShelter, CarrierWave::MiniMagick
Defined in:
app/uploaders/photo_uploader.rb

Instance Method Summary collapse

Instance Method Details

#auto_orientObject



8
9
10
11
12
# File 'app/uploaders/photo_uploader.rb', line 8

def auto_orient
  manipulate! do |image|
    image.tap(&:auto_orient)
  end
end

#default_urlObject



18
19
20
# File 'app/uploaders/photo_uploader.rb', line 18

def default_url
  ActionController::Base.helpers.asset_path('biovision/base/placeholders/photo.svg')
end

#extension_whitelistObject



48
49
50
# File 'app/uploaders/photo_uploader.rb', line 48

def extension_whitelist
  %w(jpg jpeg png)
end

#filenameObject



52
53
54
# File 'app/uploaders/photo_uploader.rb', line 52

def filename
  "#{model.uuid}.#{file.extension}" if original_filename
end

#store_dirObject



14
15
16
# File 'app/uploaders/photo_uploader.rb', line 14

def store_dir
  "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id/10000.floor}/#{model.id/100.floor}/#{model.id}"
end