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>2021-03-23 15:09:33 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-03-23 15:09:33 +0300
commitb38fc20ae0e90d5b1c538a139aa0a7da1b7b5726 (patch)
tree3ce77cdb707b75c9d74c6ff2a8386dd06bd48b44 /app/models
parentb3647b2a67930e8aa3c1b1dd9bda29c368c862ba (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models')
-rw-r--r--app/models/commit.rb2
-rw-r--r--app/models/namespace.rb9
2 files changed, 3 insertions, 8 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb
index bf168aaacc5..5b1f236b333 100644
--- a/app/models/commit.rb
+++ b/app/models/commit.rb
@@ -62,7 +62,7 @@ class Commit
collection.sort do |a, b|
operands = [a, b].tap { |o| o.reverse! if sort == 'desc' }
- attr1, attr2 = operands.first.public_send(order_by), operands.second.public_send(order_by) # rubocop:disable PublicSend
+ attr1, attr2 = operands.first.public_send(order_by), operands.second.public_send(order_by) # rubocop:disable GitlabSecurity/PublicSend
# use case insensitive comparison for string values
order_by.in?(%w[email name]) ? attr1.casecmp(attr2) : attr1 <=> attr2
diff --git a/app/models/namespace.rb b/app/models/namespace.rb
index 6f6c8b387a1..e6809316274 100644
--- a/app/models/namespace.rb
+++ b/app/models/namespace.rb
@@ -261,13 +261,8 @@ class Namespace < ApplicationRecord
# Includes projects from this namespace and projects from all subgroups
# that belongs to this namespace
def all_projects
- return Project.where(namespace: self) if user?
-
- if Feature.enabled?(:recursive_namespace_lookup_as_inner_join, self)
- Project.joins("INNER JOIN (#{self_and_descendants.select(:id).to_sql}) namespaces ON namespaces.id=projects.namespace_id")
- else
- Project.where(namespace: self_and_descendants)
- end
+ namespace = user? ? self : self_and_descendants
+ Project.where(namespace: namespace)
end
# Includes pipelines from this namespace and pipelines from all subgroups