diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/models/namespace.rb | 6 | ||||
-rw-r--r-- | app/services/groups/destroy_service.rb | 3 |
2 files changed, 7 insertions, 2 deletions
diff --git a/app/models/namespace.rb b/app/models/namespace.rb index 743e0513e02..672eab94c07 100644 --- a/app/models/namespace.rb +++ b/app/models/namespace.rb @@ -219,6 +219,12 @@ class Namespace < ActiveRecord::Base parent.present? end + def soft_delete_without_removing_associations + # We can't use paranoia's `#destroy` since this will hard-delete projects. + # Project uses `pending_delete` instead of the acts_as_paranoia gem. + self.deleted_at = Time.now + end + private def repository_storage_paths diff --git a/app/services/groups/destroy_service.rb b/app/services/groups/destroy_service.rb index d40d280140a..80c51cb5a72 100644 --- a/app/services/groups/destroy_service.rb +++ b/app/services/groups/destroy_service.rb @@ -1,8 +1,7 @@ module Groups class DestroyService < Groups::BaseService def async_execute - # Soft delete via paranoia gem - group.destroy + group.soft_delete_without_removing_associations job_id = GroupDestroyWorker.perform_async(group.id, current_user.id) Rails.logger.info("User #{current_user.id} scheduled a deletion of group ID #{group.id} with job ID #{job_id}") end |