debian-mirror-gitlab/app/services/events/destroy_service.rb
2022-01-26 12:08:38 +05:30

21 lines
393 B
Ruby

# frozen_string_literal: true
module Events
class DestroyService
def initialize(project)
@project = project
end
def execute
project.events.all.delete_all
ServiceResponse.success(message: 'Events were deleted.')
rescue StandardError
ServiceResponse.error(message: 'Failed to remove events.')
end
private
attr_reader :project
end
end