summaryrefslogtreecommitdiff
path: root/lib/gitlab/import_export/attribute_cleaner.rb
blob: b9e4042220a5a680578050e2f69a89ee250a1fd4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
module Gitlab
  module ImportExport
    class AttributeCleaner
      ALLOWED_REFERENCES = RelationFactory::PROJECT_REFERENCES + RelationFactory::USER_REFERENCES

      def self.clean!(relation_hash:)
        relation_hash.reject! do |key, _value|
          key.end_with?('_id') && !ALLOWED_REFERENCES.include?(key)
        end
      end
    end
  end
end