Class: Ci::PipelineArtifact
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- ApplicationRecord
- Ci::PipelineArtifact
- Includes:
- Artifactable, FileStoreMounter, Presentable, UpdateProjectStatistics
- Defined in:
- app/models/ci/pipeline_artifact.rb
Constant Summary collapse
- FILE_SIZE_LIMIT =
10.megabytes.freeze
- EXPIRATION_DATE =
1.week.freeze
- DEFAULT_FILE_NAMES =
{ code_coverage: 'code_coverage.json', code_quality_mr_diff: 'code_quality_mr_diff.json' }.freeze
- REPORT_TYPES =
{ code_coverage: :raw, code_quality_mr_diff: :raw }.freeze
Constants included from Artifactable
Artifactable::FILE_FORMAT_ADAPTERS, Artifactable::NotSupportedAdapterError, Artifactable::STORE_COLUMN
Constants inherited from ApplicationRecord
Class Method Summary collapse
Instance Method Summary collapse
Methods included from FileStoreMounter
Methods included from Artifactable
Methods included from AfterCommitQueue
#run_after_commit, #run_after_commit_or_now
Methods inherited from ApplicationRecord
Methods inherited from ApplicationRecord
cached_column_list, #create_or_load_association, declarative_enum, default_select_columns, id_in, id_not_in, iid_in, pluck_primary_key, primary_key_in, #readable_by?, safe_ensure_unique, safe_find_or_create_by, safe_find_or_create_by!, #to_ability_name, underscore, where_exists, where_not_exists, with_fast_read_statement_timeout, without_order
Methods included from SensitiveSerializableHash
Class Method Details
.find_by_file_type(file_type) ⇒ Object
51 52 53 |
# File 'app/models/ci/pipeline_artifact.rb', line 51 def find_by_file_type(file_type) find_by(file_type: file_type) end |
.report_exists?(file_type) ⇒ Boolean
45 46 47 48 49 |
# File 'app/models/ci/pipeline_artifact.rb', line 45 def report_exists?(file_type) return false unless REPORT_TYPES.key?(file_type) where(file_type: file_type).exists? end |
Instance Method Details
#present ⇒ Object
56 57 58 |
# File 'app/models/ci/pipeline_artifact.rb', line 56 def present super(presenter_class: "Ci::PipelineArtifacts::#{self.file_type.camelize}Presenter".constantize) end |