Skip to content

Commit

Permalink
loading is not needed with zeitwerk autoloader
Browse files Browse the repository at this point in the history
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:
ManageIQ/manageiq#22801

Part of the rails 7 upgrade: ManageIQ/manageiq#22052
  • Loading branch information
jrafanie committed Dec 4, 2023
1 parent cc89506 commit 37eb071
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
8 changes: 2 additions & 6 deletions app/controllers/api/providers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 3 additions & 6 deletions lib/api/environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 37eb071

Please sign in to comment.