From 45c68b5a989f8d32db7a84c53aa341a8cbfe70dd Mon Sep 17 00:00:00 2001 From: charlieablett Date: Tue, 30 Apr 2019 17:07:51 +1200 Subject: [PATCH] Refactor AttributeCleaner` for readability --- lib/gitlab/import_export/attribute_cleaner.rb | 9 ++------- 1 file 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) -- GitLab