Commit 1305663c authored by Thong Kuah's avatar Thong Kuah

Auto-correct ee const_get offenses

parent 3a884228
......@@ -22,7 +22,7 @@ module EE
validates :"#{type}_access_levels", length: { is: 1 }, if: -> { false }
# Returns access levels that grant the specified access type to the given user / group.
access_level_class = const_get("#{type}_access_level".classify)
access_level_class = const_get("#{type}_access_level".classify, false)
protected_type = self.model_name.singular
scope(
:"#{type}_access_by_user",
......
......@@ -4,7 +4,7 @@ module EE
extend ActiveSupport::Concern
prepended do
EE_CALLOUT_FAILURE_MESSAGES = const_get(:CALLOUT_FAILURE_MESSAGES).merge(
EE_CALLOUT_FAILURE_MESSAGES = const_get(:CALLOUT_FAILURE_MESSAGES, false).merge(
protected_environment_failure: 'The environment this job is deploying to is protected. Only users with permission may successfully run this job.',
insufficient_bridge_permissions: 'This job could not be executed because of insufficient permissions to create a downstream pipeline.',
insufficient_upstream_permissions: 'This job could not be executed because of insufficient permissions to track the upstream project.',
......
......@@ -7,7 +7,7 @@ module EE
include ::Gitlab::Utils::StrongMemoize
prepended do
EE_UPDATE_SERVICES = const_get(:UPDATE_SERVICES).merge(
EE_UPDATE_SERVICES = const_get(:UPDATE_SERVICES, false).merge(
'Epic' => Epics::UpdateService
).freeze
EE::Notes::QuickActionsService.private_constant :EE_UPDATE_SERVICES
......
......@@ -9,7 +9,7 @@ module EE
extend ActiveSupport::Concern
prepended do
EE_TYPES = const_get(:TYPES) + [::EE::Gitlab::Ci::Config::Entry::Bridge]
EE_TYPES = const_get(:TYPES, false) + [::EE::Gitlab::Ci::Config::Entry::Bridge]
end
class_methods do
......
......@@ -9,7 +9,7 @@ module EE
extend ActiveSupport::Concern
prepended do
EE_REASONS = const_get(:REASONS).merge(
EE_REASONS = const_get(:REASONS, false).merge(
protected_environment_failure: 'protected environment failure',
invalid_bridge_trigger: 'downstream pipeline trigger definition is invalid',
downstream_bridge_project_not_found: 'downstream project could not be found',
......
......@@ -9,7 +9,7 @@ module Elastic
def initialize(target)
super(target)
config = version_namespace.const_get('Config')
config = version_namespace.const_get('Config', false)
@index_name = config.index_name
@document_type = config.document_type
......
......@@ -9,7 +9,7 @@ module Elastic
def initialize(target)
super(target)
config = version_namespace.const_get('Config')
config = version_namespace.const_get('Config', false)
@index_name = config.index_name
@document_type = config.document_type
......
......@@ -12,8 +12,8 @@ module Elastic
# @params version [String, Module] can be a string "V12p1" or module (Elastic::V12p1)
def version(version)
version = Elastic.const_get(version) if version.is_a?(String)
version.const_get(proxy_class_name).new(data_target)
version = Elastic.const_get(version, false) if version.is_a?(String)
version.const_get(proxy_class_name, false).new(data_target)
end
private
......
......@@ -159,7 +159,7 @@ describe 'GlobalSearch', :elastic do
# access_level can be :disabled, :enabled or :private
def feature_settings(access_level)
Hash[features.collect { |k| ["#{k}_access_level", ProjectFeature.const_get(access_level.to_s.upcase)] }]
Hash[features.collect { |k| ["#{k}_access_level", ProjectFeature.const_get(access_level.to_s.upcase, false)] }]
end
def expect_no_items_to_be_found(user)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment