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

namespace.rb « models « user_mentions « background_migration « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6d7b9a86e69ff7830cb13065e51aa2e422a4d746 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# frozen_string_literal: true

module Gitlab
  module BackgroundMigration
    module UserMentions
      module Models
        # isolated Namespace model
        class Namespace < ApplicationRecord
          include ::Gitlab::VisibilityLevel
          include ::Gitlab::Utils::StrongMemoize
          include Gitlab::BackgroundMigration::UserMentions::Models::Concerns::Namespace::RecursiveTraversal

          belongs_to :parent, class_name: "::Gitlab::BackgroundMigration::UserMentions::Models::Namespace"

          def visibility_level_field
            :visibility_level
          end

          def has_parent?
            parent_id.present? || parent.present?
          end

          # Overridden in EE::Namespace
          def feature_available?(_feature)
            false
          end
        end
      end
    end
  end
end

Namespace.prepend_if_ee('::EE::Namespace')