mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-12-27 04:51:14 +00:00
20 lines
No EOL
608 B
Ruby
20 lines
No EOL
608 B
Ruby
# encoding: utf-8
|
|
|
|
class FileUploader < CarrierWave::Uploader::Base
|
|
# Override the directory where uploaded files will be stored.
|
|
# This is a sensible default for uploaders that are meant to be mounted:
|
|
def store_dir
|
|
if model and model.directory
|
|
# This is a recursive look up
|
|
model.directory.full_path
|
|
else
|
|
Directory.find(Directory::ROOT).full_path
|
|
end
|
|
# .gsub(/public\//, '')
|
|
end
|
|
|
|
# Provide a default URL as a default if there hasn't been a file uploaded:
|
|
# def default_url
|
|
# "/images/fallback/" + [version_name, "default.png"].compact.join('_')
|
|
# end
|
|
end |