From eee53ee37a7dd0a65f357ea8e4950b965524b9bb Mon Sep 17 00:00:00 2001 From: Joe Rafaniello Date: Mon, 4 Mar 2024 18:04:55 -0500 Subject: [PATCH] Move to AS::DescendantsTracker.subclasses. We were using a private class variable. There's a public interface we can use and avoid a deprecation by switching from the variable to subclasses: ActiveSupport::DescendantsTracker.direct_descendants is deprecated and will be removed in Rails 7.1. Use ActiveSupport::DescendantsTracker.subclasses instead. --- spec/models/mixins/supports_feature_mixin_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/models/mixins/supports_feature_mixin_spec.rb b/spec/models/mixins/supports_feature_mixin_spec.rb index 7b34ae03d1c..625cfaea633 100644 --- a/spec/models/mixins/supports_feature_mixin_spec.rb +++ b/spec/models/mixins/supports_feature_mixin_spec.rb @@ -352,7 +352,7 @@ def define_subclass(module_name, parent, supports_values = {}) # this cleans out those values so future runs do not have bogus classes # this causes sporadic test failures. def cleanup_subclass(parent, children) - tracker = ActiveSupport::DescendantsTracker.class_variable_get(:@@direct_descendants)[parent] + tracker = ActiveSupport::DescendantsTracker.subclasses(parent) tracker&.reject! { |child| children.include?(child) } end