Welcome to mirror list, hosted at ThFree Co, Russian Federation.

default_organization_importer.rb « database_importers « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 147c0d19b0131ac1c55c240606a23551ea87b454 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

module Gitlab
  module DatabaseImporters
    module DefaultOrganizationImporter
      def self.create_default_organization
        return if Organizations::Organization.default_organization

        # When adding or changing attributes, consider changing the factory for Organization model as well
        # spec/factories/organizations/organizations.rb
        Organizations::Organization.create!(
          id: Organizations::Organization::DEFAULT_ORGANIZATION_ID,
          name: 'Default',
          path: 'default'
        )
      end
    end
  end
end