Commit 9e0b7c63 authored by James Lopez's avatar James Lopez

updated attribute cleaner to use allowed keyword and reject attributes

parent 4c480be3
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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment