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>2022-01-11 18:15:55 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-01-11 18:15:55 +0300
commita8281ac43424e4b820286823bdb48f068b21d7d3 (patch)
treef8064c724e33f22402ecc4bd0a8c23ea01e6eac1 /app/models
parent22391da1261240ecc15aa15cbb19b089339902b5 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models')
-rw-r--r--app/models/clusters/agent_token.rb1
-rw-r--r--app/models/namespace_setting.rb15
2 files changed, 1 insertions, 15 deletions
diff --git a/app/models/clusters/agent_token.rb b/app/models/clusters/agent_token.rb
index d4f6beb045a..bcef6b6ecc8 100644
--- a/app/models/clusters/agent_token.rb
+++ b/app/models/clusters/agent_token.rb
@@ -22,6 +22,7 @@ module Clusters
validates :name, presence: true, length: { maximum: 255 }
scope :order_last_used_at_desc, -> { order(::Gitlab::Database.nulls_last_order('last_used_at', 'DESC')) }
+ scope :with_status, -> (status) { where(status: status) }
enum status: {
active: 0,
diff --git a/app/models/namespace_setting.rb b/app/models/namespace_setting.rb
index 170b29e9e21..ed0ac092954 100644
--- a/app/models/namespace_setting.rb
+++ b/app/models/namespace_setting.rb
@@ -12,9 +12,6 @@ class NamespaceSetting < ApplicationRecord
validate :allow_mfa_for_group
validate :allow_resource_access_token_creation_for_group
- before_save :set_prevent_sharing_groups_outside_hierarchy, if: -> { user_cap_enabled? }
- after_save :disable_project_sharing!, if: -> { user_cap_enabled? }
-
before_validation :normalize_default_branch_name
enum jobs_to_be_done: { basics: 0, move_repository: 1, code_storage: 2, exploring: 3, ci: 4, other: 5 }, _suffix: true
@@ -59,18 +56,6 @@ class NamespaceSetting < ApplicationRecord
errors.add(:resource_access_token_creation_allowed, _('is not allowed since the group is not top-level group.'))
end
end
-
- def set_prevent_sharing_groups_outside_hierarchy
- self.prevent_sharing_groups_outside_hierarchy = true
- end
-
- def disable_project_sharing!
- namespace.update_attribute(:share_with_group_lock, true)
- end
-
- def user_cap_enabled?
- new_user_signups_cap.present? && namespace.root?
- end
end
NamespaceSetting.prepend_mod_with('NamespaceSetting')