From 37eb071cd0da83de4140561ee9020c2b85dd853a 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 | 9 +++------ 2 files changed, 5 insertions(+), 12 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..a6b1e5cc6c 100644 --- a/lib/api/environment.rb +++ b/lib/api/environment.rb @@ -26,12 +26,9 @@ def self.time_attributes 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