Merge pull request #4675 from artoscinote/ma_SCI_7382

Add missing job [SCI-7382]
This commit is contained in:
artoscinote 2022-12-02 09:51:43 +01:00 committed by GitHub
commit 212429c5be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,15 @@
# frozen_string_literal: true
module MyModules
class CopyContentJob < ApplicationJob
def perform(user, source_my_module_id, target_my_module_id)
MyModule.transaction do
target_my_module = MyModule.find(target_my_module_id)
MyModule.find(source_my_module_id).copy_content(user, target_my_module)
target_my_module.update!(provisioning_status: :done)
end
rescue StandardError => _e
target_my_module.update(provisioning_status: :failed)
end
end
end