summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorcharlieablett <cablett@gitlab.com>2019-04-30 11:25:09 +1200
committercharlieablett <cablett@gitlab.com>2019-04-30 11:25:09 +1200
commit1cbdc5326c779999350481b0aae78364837f3bb6 (patch)
tree8125dbf2ba8c5cc86abead4cdfd1ee1e3b21e98d /lib
parentb240012c4f474fc9ac24afb3286fbc967cde86d4 (diff)
downloadgitlab-ce-1cbdc5326c779999350481b0aae78364837f3bb6.tar.gz
Refactor `attribute_cleaner` for readability
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/import_export/attribute_cleaner.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/gitlab/import_export/attribute_cleaner.rb b/lib/gitlab/import_export/attribute_cleaner.rb
index 537cb36c89b..7f67f63f26b 100644
--- a/lib/gitlab/import_export/attribute_cleaner.rb
+++ b/lib/gitlab/import_export/attribute_cleaner.rb
@@ -18,13 +18,15 @@ module Gitlab
def clean
@relation_hash.reject do |key, _value|
- (prohibited_key?(key) && !permitted_key?(key)) || !@relation_class.attribute_method?(key) || excluded_key?(key)
+ prohibited_key?(key) || !@relation_class.attribute_method?(key) || excluded_key?(key)
end.except('id')
end
private
def prohibited_key?(key)
+ return false if permitted_key?(key)
+
'cached_markdown_version' == key || PROHIBITED_SUFFIXES.any? {|suffix| key.end_with?(suffix)}
end