diff options
Diffstat (limited to 'app/services/ml/destroy_model_service.rb')
-rw-r--r-- | app/services/ml/destroy_model_service.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/app/services/ml/destroy_model_service.rb b/app/services/ml/destroy_model_service.rb new file mode 100644 index 00000000000..308d289fbe1 --- /dev/null +++ b/app/services/ml/destroy_model_service.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Ml + class DestroyModelService + def initialize(model, user) + @model = model + @user = user + end + + def execute + return unless @model.destroy + + ::Packages::MarkPackagesForDestructionService.new( + packages: @model.all_packages, + current_user: @user + ).execute + end + end +end |