summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcharlieablett <cablett@gitlab.com>2019-04-30 17:07:51 +1200
committercharlieablett <cablett@gitlab.com>2019-04-30 17:09:44 +1200
commit45c68b5a989f8d32db7a84c53aa341a8cbfe70dd (patch)
treed74e514634679eb60ad4e4e92f74f986b892f249
parent4b92cb50aa7a937a2671e48a21c1cfaca661699b (diff)
downloadgitlab-ce-45c68b5a989f8d32db7a84c53aa341a8cbfe70dd.tar.gz
Refactor AttributeCleaner` for readability
-rw-r--r--lib/gitlab/import_export/attribute_cleaner.rb9
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/gitlab/import_export/attribute_cleaner.rb b/lib/gitlab/import_export/attribute_cleaner.rb
index f476905b6db..b27a2a9fb65 100644
--- a/lib/gitlab/import_export/attribute_cleaner.rb
+++ b/lib/gitlab/import_export/attribute_cleaner.rb
@@ -24,14 +24,9 @@ module Gitlab
private
def prohibited_key?(key)
- return false if allowed_reference?(key)
+ return false if permitted_key?(key)
- return true if 'cached_markdown_version'.equal?(key)
-
- prohibited_suffixes = %w(_id _html)
- prohibited_suffixes.any? do |suffix|
- true if key.end_with?(suffix)
- end
+ 'cached_markdown_version' == key || PROHIBITED_SUFFIXES.any? {|suffix| key.end_with?(suffix)}
end
def allowed_reference?(key)