Class: PhotoUploader

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

Instance Method Summary collapse

Instance Method Details

#default_urlObject



11
12
13
# File 'app/uploaders/photo_uploader.rb', line 11

def default_url
  '/fallback/' + [version_name, 'photo_default.png'].compact.join('_')
end

#extension_white_listObject



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

def extension_white_list
  %w(jpg jpeg gif png gif)
end

#store_dirObject



7
8
9
# File 'app/uploaders/photo_uploader.rb', line 7

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