2021-01-03 14:25:43 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Gitlab
|
|
|
|
module BackgroundMigration
|
|
|
|
module UserMentions
|
|
|
|
module Models
|
|
|
|
# isolated Namespace model
|
2021-04-29 21:17:54 +05:30
|
|
|
class Namespace < ActiveRecord::Base
|
|
|
|
self.inheritance_column = :_type_disabled
|
|
|
|
|
|
|
|
include Concerns::IsolatedFeatureGate
|
|
|
|
include Gitlab::BackgroundMigration::UserMentions::Lib::Gitlab::IsolatedVisibilityLevel
|
2021-01-03 14:25:43 +05:30
|
|
|
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
|
|
|
|
|
2021-04-29 21:17:54 +05:30
|
|
|
# Deprecated, use #licensed_feature_available? instead. Remove once Namespace#feature_available? isn't used anymore.
|
|
|
|
def feature_available?(feature)
|
|
|
|
licensed_feature_available?(feature)
|
|
|
|
end
|
|
|
|
|
2021-01-03 14:25:43 +05:30
|
|
|
# Overridden in EE::Namespace
|
2021-04-29 21:17:54 +05:30
|
|
|
def licensed_feature_available?(_feature)
|
2021-01-03 14:25:43 +05:30
|
|
|
false
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2021-06-08 01:23:25 +05:30
|
|
|
Namespace.prepend_mod_with('Namespace')
|