summaryrefslogtreecommitdiff
path: root/lib/gitlab/import_export/attribute_cleaner.rb
diff options
context:
space:
mode:
authorcharlieablett <cablett@gitlab.com>2019-04-24 14:31:20 +1200
committercharlieablett <cablett@gitlab.com>2019-04-24 14:31:20 +1200
commit7e6befc05de87ba44115bbae0274c65727f9c2b9 (patch)
tree33465e8177975f59044c46f7d1ef3f6e8feacc8c /lib/gitlab/import_export/attribute_cleaner.rb
parentb8c3e60ea23cd8c6f32ed438fd3c155add47a8e1 (diff)
downloadgitlab-ce-7e6befc05de87ba44115bbae0274c65727f9c2b9.tar.gz
Add disallowed fields to AttributeCleaner
Diffstat (limited to 'lib/gitlab/import_export/attribute_cleaner.rb')
-rw-r--r--lib/gitlab/import_export/attribute_cleaner.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/gitlab/import_export/attribute_cleaner.rb b/lib/gitlab/import_export/attribute_cleaner.rb
index 93b37b7bc5f..1faa3c1614f 100644
--- a/lib/gitlab/import_export/attribute_cleaner.rb
+++ b/lib/gitlab/import_export/attribute_cleaner.rb
@@ -24,7 +24,19 @@ module Gitlab
private
def prohibited_key?(key)
- key.end_with?('_id') && !ALLOWED_REFERENCES.include?(key)
+ return false if allowed_reference?(key)
+
+ return true if 'cached_markdown_version'.equal?(key)
+
+ prohibited_suffices = %w(_id _html)
+ prohibited_suffices.each do |suffix|
+ return true if key.end_with?(suffix)
+ end
+ false
+ end
+
+ def allowed_reference?(key)
+ ALLOWED_REFERENCES.include?(key)
end
def excluded_key?(key)