gitlab-org--gitlab-foss/app/uploaders/namespace_file_uploader.rb

20 lines
369 B
Ruby
Raw Normal View History

2017-12-06 06:36:11 -05:00
class NamespaceFileUploader < FileUploader
2018-01-29 12:57:34 -05:00
# Re-Override
def self.root
options.storage_path
2017-12-06 06:36:11 -05:00
end
2018-01-29 12:57:34 -05:00
def self.base_dir(model)
File.join(options.base_dir, 'namespace', model_path_segment(model))
2017-12-06 06:36:11 -05:00
end
2018-01-29 12:57:34 -05:00
def self.model_path_segment(model)
File.join(model.id.to_s)
end
2017-12-06 06:36:11 -05:00
2018-01-29 12:57:34 -05:00
# Re-Override
def store_dir
File.join(base_dir, dynamic_segment)
2017-12-06 06:36:11 -05:00
end
end