Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-02-08 00:09:58 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-02-08 00:09:58 +0300
commit919e3e3cd83e76dba137ef9bcc4746214c2085ff (patch)
tree4e9799b9c6193583896ea1f05137815ff9782796 /app/models
parent6cae2159b8ce1e84fad48f3dbd5368995cbd87b1 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models')
-rw-r--r--app/models/ci/job_token/project_scope_link.rb5
-rw-r--r--app/models/project.rb1
2 files changed, 4 insertions, 2 deletions
diff --git a/app/models/ci/job_token/project_scope_link.rb b/app/models/ci/job_token/project_scope_link.rb
index 4fb577f58bc..774d85e3d3c 100644
--- a/app/models/ci/job_token/project_scope_link.rb
+++ b/app/models/ci/job_token/project_scope_link.rb
@@ -13,8 +13,9 @@ module Ci
belongs_to :target_project, class_name: 'Project'
belongs_to :added_by, class_name: 'User'
- scope :with_source, ->(project) { where(source_project: project) }
- scope :with_target, ->(project) { where(target_project: project) }
+ scope :with_access_direction, ->(direction) { where(direction: direction) }
+ scope :with_source, ->(project) { where(source_project: project) }
+ scope :with_target, ->(project) { where(target_project: project) }
validates :source_project, presence: true
validates :target_project, presence: true
diff --git a/app/models/project.rb b/app/models/project.rb
index 8cb17632170..0012603466e 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -825,6 +825,7 @@ class Project < ApplicationRecord
scope :for_group, -> (group) { where(group: group) }
scope :for_group_and_its_subgroups, ->(group) { where(namespace_id: group.self_and_descendants.select(:id)) }
scope :for_group_and_its_ancestor_groups, ->(group) { where(namespace_id: group.self_and_ancestors.select(:id)) }
+ scope :is_importing, -> { with_import_state.where(import_state: { status: %w[started scheduled] }) }
class << self
# Searches for a list of projects based on the query given in `query`.