diff options
author | James Lopez <james@jameslopez.es> | 2016-09-27 16:12:08 +0200 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2016-09-27 16:12:08 +0200 |
commit | 9e0b7c630f2fc64805062d0c7e02fd6092631071 (patch) | |
tree | 9b79a3f25872ed3ed7764bf8fed84587b82bbcd7 /lib | |
parent | 4c480be39b0862f41043e94a6dc5b943b6f8e8f0 (diff) | |
download | gitlab-ce-9e0b7c630f2fc64805062d0c7e02fd6092631071.tar.gz |
updated attribute cleaner to use allowed keyword and reject attributes
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/import_export/attribute_cleaner.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/gitlab/import_export/attribute_cleaner.rb b/lib/gitlab/import_export/attribute_cleaner.rb index c12b898a665..b9e4042220a 100644 --- a/lib/gitlab/import_export/attribute_cleaner.rb +++ b/lib/gitlab/import_export/attribute_cleaner.rb @@ -1,11 +1,11 @@ module Gitlab module ImportExport class AttributeCleaner - IGNORED_REFERENCES = Gitlab::ImportExport::RelationFactory::PROJECT_REFERENCES + Gitlab::ImportExport::RelationFactory::USER_REFERENCES + ALLOWED_REFERENCES = RelationFactory::PROJECT_REFERENCES + RelationFactory::USER_REFERENCES def self.clean!(relation_hash:) - relation_hash.select! do |key, _value| - IGNORED_REFERENCES.include?(key) || !key.end_with?('_id') + relation_hash.reject! do |key, _value| + key.end_with?('_id') && !ALLOWED_REFERENCES.include?(key) end end end |