a8c62dfe5c
- Moves a duplicate `file_storage?` definition into the common `GitlabUploader` ancestor. - Get the `uploads` base directory from a class method rather than hard-coding it where it's needed. This will be used in a subsequent MR to store Uploads in the database. - Improves the specs for uploaders.
21 lines
319 B
Ruby
21 lines
319 B
Ruby
class GitlabUploader < CarrierWave::Uploader::Base
|
|
def self.base_dir
|
|
'uploads'
|
|
end
|
|
|
|
delegate :base_dir, to: :class
|
|
|
|
def file_storage?
|
|
self.class.storage == CarrierWave::Storage::File
|
|
end
|
|
|
|
# Reduce disk IO
|
|
def move_to_cache
|
|
true
|
|
end
|
|
|
|
# Reduce disk IO
|
|
def move_to_store
|
|
true
|
|
end
|
|
end
|