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-11-18 16:16:36 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-11-18 16:16:36 +0300
commit311b0269b4eb9839fa63f80c8d7a58f32b8138a0 (patch)
tree07e7870bca8aed6d61fdcc810731c50d2c40af47 /app/models/group.rb
parent27909cef6c4170ed9205afa7426b8d3de47cbb0c (diff)
Add latest changes from gitlab-org/gitlab@14-5-stable-eev14.5.0-rc42
Diffstat (limited to 'app/models/group.rb')
-rw-r--r--app/models/group.rb30
1 files changed, 9 insertions, 21 deletions
diff --git a/app/models/group.rb b/app/models/group.rb
index c5e119451e3..2dd20300ad2 100644
--- a/app/models/group.rb
+++ b/app/models/group.rb
@@ -56,6 +56,9 @@ class Group < Namespace
has_many :boards
has_many :badges, class_name: 'GroupBadge'
+ has_many :organizations, class_name: 'CustomerRelations::Organization', inverse_of: :group
+ has_many :contacts, class_name: 'CustomerRelations::Contact', inverse_of: :group
+
has_many :cluster_groups, class_name: 'Clusters::Group'
has_many :clusters, through: :cluster_groups, class_name: 'Clusters::Cluster'
@@ -194,13 +197,8 @@ class Group < Namespace
def ids_with_disabled_email(groups)
inner_groups = Group.where('id = namespaces_with_emails_disabled.id')
- inner_ancestors = if Feature.enabled?(:linear_group_ancestor_scopes, default_enabled: :yaml)
- inner_groups.self_and_ancestors
- else
- Gitlab::ObjectHierarchy.new(inner_groups).base_and_ancestors
- end
-
- inner_query = inner_ancestors
+ inner_query = inner_groups
+ .self_and_ancestors
.where(emails_disabled: true)
.select('1')
.limit(1)
@@ -317,13 +315,15 @@ class Group < Namespace
owners.include?(user)
end
- def add_users(users, access_level, current_user: nil, expires_at: nil)
+ def add_users(users, access_level, current_user: nil, expires_at: nil, tasks_to_be_done: [], tasks_project_id: nil)
Members::Groups::BulkCreatorService.add_users( # rubocop:disable CodeReuse/ServiceClass
self,
users,
access_level,
current_user: current_user,
- expires_at: expires_at
+ expires_at: expires_at,
+ tasks_to_be_done: tasks_to_be_done,
+ tasks_project_id: tasks_project_id
)
end
@@ -760,18 +760,6 @@ class Group < Namespace
Timelog.in_group(self)
end
- def cached_issues_state_count_enabled?
- Feature.enabled?(:cached_issues_state_count, self, default_enabled: :yaml)
- end
-
- def organizations
- ::CustomerRelations::Organization.where(group_id: self.id)
- end
-
- def contacts
- ::CustomerRelations::Contact.where(group_id: self.id)
- end
-
def dependency_proxy_image_ttl_policy
super || build_dependency_proxy_image_ttl_policy
end