debian-mirror-gitlab/app/services/events/destroy_service.rb

22 lines
393 B
Ruby
Raw Normal View History

2022-01-26 12:08:38 +05:30
# 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