2016-08-12 10:04:33 +00:00
|
|
|
module Gitlab
|
|
|
|
module ImportExport
|
|
|
|
class AttributeCleaner
|
2016-09-27 14:12:08 +00:00
|
|
|
ALLOWED_REFERENCES = RelationFactory::PROJECT_REFERENCES + RelationFactory::USER_REFERENCES
|
2016-08-12 10:04:33 +00:00
|
|
|
|
|
|
|
def self.clean!(relation_hash:)
|
2016-09-27 14:12:08 +00:00
|
|
|
relation_hash.reject! do |key, _value|
|
|
|
|
key.end_with?('_id') && !ALLOWED_REFERENCES.include?(key)
|
2016-08-12 10:04:33 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|