From 8885e1ea6d1ba5656ec7a29d9d7af8aec5b5fd17 Mon Sep 17 00:00:00 2001 From: Joe Rafaniello Date: Mon, 4 Dec 2023 16:18:12 -0500 Subject: [PATCH] loading is not needed with zeitwerk autoloader This was only needed for classic autoloader. The core "freedom" patch made zeitwerk autoloader bypass the interlock anyway, so now that we're only supporting zeitwerk, this is no longer needed. Co-dependency: https://github.com/ManageIQ/manageiq/pull/22801 Part of the rails 7 upgrade: https://github.com/ManageIQ/manageiq/issues/22052 --- app/controllers/api/providers_controller.rb | 8 ++------ lib/api/environment.rb | 12 ++++-------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/app/controllers/api/providers_controller.rb b/app/controllers/api/providers_controller.rb index 0e5fa18664..6341a6e8da 100644 --- a/app/controllers/api/providers_controller.rb +++ b/app/controllers/api/providers_controller.rb @@ -141,15 +141,11 @@ def provider_options(type) end def permitted_subclasses - ActiveSupport::Dependencies.interlock.loading do - ManageIQ::Providers::BaseManager.permitted_subclasses - end + ManageIQ::Providers::BaseManager.permitted_subclasses end def supported_types_for_create - ActiveSupport::Dependencies.interlock.loading do - ExtManagementSystem.supported_types_for_create - end + ExtManagementSystem.supported_types_for_create end def providers_options diff --git a/lib/api/environment.rb b/lib/api/environment.rb index e82902483c..0df075dde8 100644 --- a/lib/api/environment.rb +++ b/lib/api/environment.rb @@ -24,14 +24,10 @@ def self.encrypted_attributes_whitelist def self.time_attributes @time_attributes ||= ApiConfig.collections.each.with_object(Set.new(%w(expires_on))) do |(_, cspec), result| next if cspec[:klass].blank? - klass = nil - - # Ensure we're the only thread trying to autoload classes and their columns - ActiveSupport::Dependencies.interlock.loading do - klass = cspec[:klass].constantize - klass.columns_hash.each do |name, typeobj| - result << name if %w(date datetime).include?(typeobj.type.to_s) - end + + klass = cspec[:klass].constantize + klass.columns_hash.each do |name, typeobj| + result << name if %w(date datetime).include?(typeobj.type.to_s) end end end