Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/github_import/importer/attachments/merge_requests_importer.rb')
-rw-r--r--lib/gitlab/github_import/importer/attachments/merge_requests_importer.rb37
1 files changed, 37 insertions, 0 deletions
diff --git a/lib/gitlab/github_import/importer/attachments/merge_requests_importer.rb b/lib/gitlab/github_import/importer/attachments/merge_requests_importer.rb
new file mode 100644
index 00000000000..f41071b1785
--- /dev/null
+++ b/lib/gitlab/github_import/importer/attachments/merge_requests_importer.rb
@@ -0,0 +1,37 @@
+# frozen_string_literal: true
+
+module Gitlab
+ module GithubImport
+ module Importer
+ module Attachments
+ class MergeRequestsImporter < ::Gitlab::GithubImport::Importer::Attachments::BaseImporter
+ def sidekiq_worker_class
+ ::Gitlab::GithubImport::Attachments::ImportMergeRequestWorker
+ end
+
+ def collection_method
+ :merge_request_attachments
+ end
+
+ def object_type
+ :merge_request_attachment
+ end
+
+ def id_for_already_imported_cache(merge_request)
+ merge_request.id
+ end
+
+ private
+
+ def collection
+ project.merge_requests.select(:id, :description)
+ end
+
+ def ordering_column
+ :iid
+ end
+ end
+ end
+ end
+ end
+end