Class: MediumUploader

Inherits:
CarrierWave::Uploader::Base
  • Object
show all
Defined in:
lib/has_media/uploaders/medium_uploader.rb

Instance Method Summary collapse

Instance Method Details

#rootObject



15
16
17
# File 'lib/has_media/uploaders/medium_uploader.rb', line 15

def root
  HasMedia.directory_path
end

#store_dirObject

Override the directory where uploaded files will be stored This is a sensible default for uploaders that are meant to be mounted:



9
10
11
12
# File 'lib/has_media/uploaders/medium_uploader.rb', line 9

def store_dir
  type = ActiveSupport::Inflector.underscore(model.class.to_s)
  "#{HasMedia.directory_path}/#{type}/#{model.id}"
end