diff options
author | charlieablett <cablett@gitlab.com> | 2019-04-30 17:07:51 +1200 |
---|---|---|
committer | charlieablett <cablett@gitlab.com> | 2019-04-30 17:07:51 +1200 |
commit | 32e24b65e8da361c9ad77bc26228980c0965b3d3 (patch) | |
tree | 9c98d0b44ec5141874497847dc4de308d41cc379 | |
parent | 92388917aa05e2b8eba5c9906b168140399bbd8d (diff) | |
download | gitlab-ce-32e24b65e8da361c9ad77bc26228980c0965b3d3.tar.gz |
Refactor AttributeCleaner` for readability
-rw-r--r-- | lib/gitlab/import_export/attribute_cleaner.rb | 9 |
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) |