diff options
Diffstat (limited to 'app/services/groups')
-rw-r--r-- | app/services/groups/destroy_service.rb | 2 | ||||
-rw-r--r-- | app/services/groups/transfer_service.rb | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/app/services/groups/destroy_service.rb b/app/services/groups/destroy_service.rb index 93d84bd8a9c..641111aeadc 100644 --- a/app/services/groups/destroy_service.rb +++ b/app/services/groups/destroy_service.rb @@ -9,6 +9,7 @@ module Groups Rails.logger.info("User #{current_user.id} scheduled a deletion of group ID #{group.id} with job ID #{job_id}") end + # rubocop: disable CodeReuse/ActiveRecord def execute group.prepare_for_destroy @@ -30,5 +31,6 @@ module Groups group.destroy end + # rubocop: enable CodeReuse/ActiveRecord end end diff --git a/app/services/groups/transfer_service.rb b/app/services/groups/transfer_service.rb index ea7576077f3..5efa746dfb9 100644 --- a/app/services/groups/transfer_service.rb +++ b/app/services/groups/transfer_service.rb @@ -64,9 +64,11 @@ module Groups end end + # rubocop: disable CodeReuse/ActiveRecord def namespace_with_same_path? Namespace.exists?(path: @group.path, parent: @new_parent_group) end + # rubocop: enable CodeReuse/ActiveRecord def update_group_attributes if @new_parent_group && @new_parent_group.visibility_level < @group.visibility_level @@ -78,6 +80,7 @@ module Groups @group.save! end + # rubocop: disable CodeReuse/ActiveRecord def update_children_and_projects_visibility descendants = @group.descendants.where("visibility_level > ?", @new_parent_group.visibility_level) @@ -90,6 +93,7 @@ module Groups .where("visibility_level > ?", @new_parent_group.visibility_level) .update_all(visibility_level: @new_parent_group.visibility_level) end + # rubocop: enable CodeReuse/ActiveRecord def raise_transfer_error(message) raise TransferError, ERROR_MESSAGES[message] |