summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-11-11 15:08:46 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-11-11 15:08:46 +0000
commit5fc3c77e2b08746bd39bfffae0c5918d63178433 (patch)
treef6d8d49f2caa07da9c09dc3333849b4c39cc857d /app/models
parent9517d0eb2ca8bde02d7fae2173e0a43b67b2b9f5 (diff)
downloadgitlab-ce-5fc3c77e2b08746bd39bfffae0c5918d63178433.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models')
-rw-r--r--app/models/ci/pipeline.rb1
-rw-r--r--app/models/concerns/enums/ci/pipeline.rb4
-rw-r--r--app/models/pages_deployment.rb4
3 files changed, 7 insertions, 2 deletions
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb
index c516b42dbd0..3b8c86f2db9 100644
--- a/app/models/ci/pipeline.rb
+++ b/app/models/ci/pipeline.rb
@@ -277,6 +277,7 @@ module Ci
scope :internal, -> { where(source: internal_sources) }
scope :no_child, -> { where.not(source: :parent_pipeline) }
scope :ci_sources, -> { where(source: Enums::Ci::Pipeline.ci_sources.values) }
+ scope :ci_and_parent_sources, -> { where(source: Enums::Ci::Pipeline.ci_and_parent_sources.values) }
scope :for_user, -> (user) { where(user: user) }
scope :for_sha, -> (sha) { where(sha: sha) }
scope :for_source_sha, -> (source_sha) { where(source_sha: source_sha) }
diff --git a/app/models/concerns/enums/ci/pipeline.rb b/app/models/concerns/enums/ci/pipeline.rb
index f1bc43a12d8..bb8df37f649 100644
--- a/app/models/concerns/enums/ci/pipeline.rb
+++ b/app/models/concerns/enums/ci/pipeline.rb
@@ -53,6 +53,10 @@ module Enums
sources.except(*dangling_sources.keys)
end
+ def self.ci_and_parent_sources
+ ci_sources.merge(sources.slice(:parent_pipeline))
+ end
+
# Returns the `Hash` to use for creating the `config_sources` enum for
# `Ci::Pipeline`.
def self.config_sources
diff --git a/app/models/pages_deployment.rb b/app/models/pages_deployment.rb
index f60f04aa804..61818a63764 100644
--- a/app/models/pages_deployment.rb
+++ b/app/models/pages_deployment.rb
@@ -4,6 +4,8 @@
class PagesDeployment < ApplicationRecord
include FileStoreMounter
+ attribute :file_store, :integer, default: -> { ::Pages::DeploymentUploader.default_store }
+
belongs_to :project, optional: false
belongs_to :ci_build, class_name: 'Ci::Build', optional: true
@@ -17,8 +19,6 @@ class PagesDeployment < ApplicationRecord
before_validation :set_size, if: :file_changed?
- default_value_for(:file_store) { ::Pages::DeploymentUploader.default_store }
-
mount_file_store_uploader ::Pages::DeploymentUploader
def log_geo_deleted_event