debian-mirror-gitlab/app/uploaders/personal_file_uploader.rb
2017-08-17 22:00:37 +05:30

15 lines
354 B
Ruby

class PersonalFileUploader < FileUploader
def self.dynamic_path_segment(model)
File.join(CarrierWave.root, model_path(model))
end
private
def secure_url
File.join(self.class.model_path(model), secret, file.filename)
end
def self.model_path(model)
File.join("/#{base_dir}", model.class.to_s.underscore, model.id.to_s)
end
end