lib/with_model/model.rb in with_model-2.1.5 vs lib/with_model/model.rb in with_model-2.1.6
- old
+ new
@@ -53,10 +53,14 @@
@model.reset_column_information
end
def cleanup_descendants_tracking
if defined?(ActiveSupport::DescendantsTracker)
- ActiveSupport::DescendantsTracker.class_variable_get(:@@direct_descendants).delete(ActiveRecord::Base)
+ if ActiveSupport::VERSION::MAJOR >= 7
+ ActiveSupport::DescendantsTracker.clear([ActiveRecord::Base])
+ else
+ ActiveSupport::DescendantsTracker.class_variable_get(:@@direct_descendants).delete(ActiveRecord::Base)
+ end
elsif @model.superclass.respond_to?(:direct_descendants)
@model.superclass.direct_descendants.delete(@model)
end
end