Skip to content

Commit

Permalink
test: fix occasional failure case
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredcwhite committed Mar 16, 2024
1 parent 29c5178 commit c53423f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions bridgetown-core/lib/bridgetown-core/utils/loaders_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ def clear_descendants_for_reload(_cpath, value, _abspath)
end

# TODO: this could probably be refactored to work like the above
ActiveSupport::DescendantsTracker.class_variable_get(
:@@direct_descendants
)[value.superclass]&.reject! { _1 == value }
if ActiveSupport::DescendantsTracker.class_variables.include?(:@@direct_descendants)
ActiveSupport::DescendantsTracker.class_variable_get(
:@@direct_descendants
)[value.superclass]&.reject! { _1 == value }
end
end

def setup_loaders(autoload_paths = []) # rubocop:todo Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity
Expand Down

0 comments on commit c53423f

Please sign in to comment.