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 'app/models/bulk_imports/entity.rb')
-rw-r--r--app/models/bulk_imports/entity.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/app/models/bulk_imports/entity.rb b/app/models/bulk_imports/entity.rb
index 159617bc0a9..33ce4686e27 100644
--- a/app/models/bulk_imports/entity.rb
+++ b/app/models/bulk_imports/entity.rb
@@ -20,8 +20,6 @@
class BulkImports::Entity < ApplicationRecord
self.table_name = 'bulk_import_entities'
- EXPORT_RELATIONS_URL = '/%{resource}/%{full_path}/export_relations'
-
belongs_to :bulk_import, optional: false
belongs_to :parent, class_name: 'BulkImports::Entity', optional: true
@@ -112,14 +110,22 @@ class BulkImports::Entity < ApplicationRecord
entity_type.pluralize
end
+ def base_resource_url_path
+ "/#{pluralized_name}/#{encoded_source_full_path}"
+ end
+
def export_relations_url_path
- @export_relations_url_path ||= EXPORT_RELATIONS_URL % { resource: pluralized_name, full_path: encoded_source_full_path }
+ "#{base_resource_url_path}/export_relations"
end
def relation_download_url_path(relation)
"#{export_relations_url_path}/download?relation=#{relation}"
end
+ def wikis_url_path
+ "#{base_resource_url_path}/wikis"
+ end
+
def project?
source_type == 'project_entity'
end