diff --git a/lib/graphiti/adapters/active_record.rb b/lib/graphiti/adapters/active_record.rb index c290f92c..ee66a8ef 100644 --- a/lib/graphiti/adapters/active_record.rb +++ b/lib/graphiti/adapters/active_record.rb @@ -304,7 +304,11 @@ def destroy(model_instance) end def close - ::ActiveRecord::Base.clear_active_connections! + if ::ActiveRecord.version > 7.2 + ::ActiveRecord::Base.connection_handler.clear_active_connections! + else + ::ActiveRecord::Base.clear_active_connections! + end end def can_group?