Class: Pages::DeploymentUploader

Inherits:
GitlabUploader
  • Object
show all
Includes:
ObjectStorage::Concern
Defined in:
app/uploaders/pages/deployment_uploader.rb

Constant Summary

Constants inherited from GitlabUploader

GitlabUploader::ObjectNotReadyError, GitlabUploader::PROTECTED_METHODS

Class Method Summary collapse

Methods included from ObjectStorage::Concern

#cache!, #delete_migrated_file, #exclusive_lease_key, #exists?, #file_cache_storage?, #file_storage?, #filename, #filename=, #fog_attributes, #fog_credentials, #fog_directory, #fog_public, #migrate!, #object_store, #object_store=, #persist_object_store!, #persist_object_store?, #schedule_background_upload, #store!, #store_dir, #store_dirs, #upload_paths, #use_file, #use_open_file

Methods inherited from GitlabUploader

absolute_path, base_dir, #cache_dir, #cached_size, #exists?, #file_cache_storage?, file_storage?, #filename, #initialize, #local_url, #model_valid?, #move_to_store, #open, #relative_path, #replace_file_without_saving!, root, storage_options, #url_or_file_path, #work_dir

Constructor Details

This class inherits a constructor from GitlabUploader

Class Method Details

.background_upload_enabled?Boolean

we don't need background uploads because we upload files to the right store right away, and we already do that in the background job

Returns:

  • (Boolean)

42
43
44
# File 'app/uploaders/pages/deployment_uploader.rb', line 42

def background_upload_enabled?
  false
end

.default_storeObject


46
47
48
# File 'app/uploaders/pages/deployment_uploader.rb', line 46

def default_store
  object_store_enabled? ? ObjectStorage::Store::REMOTE : ObjectStorage::Store::LOCAL
end

.direct_upload_enabled?Boolean

we only upload this files from the rails background job so we don't need direct upload for pages deployments this method is here to ignore any user setting

Returns:

  • (Boolean)

35
36
37
# File 'app/uploaders/pages/deployment_uploader.rb', line 35

def direct_upload_enabled?
  false
end