Skip to content

Commit 8313e33

Browse files
fix: update ActiveRecord adapter w/ support for Rails 7.2+ (#478)
In ActiveRecord 7.2 the `clear_active_connections` was (re)moved to the `connection_handler` property.
1 parent 15ba979 commit 8313e33

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/graphiti/adapters/active_record.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,11 @@ def destroy(model_instance)
304304
end
305305

306306
def close
307-
::ActiveRecord::Base.clear_active_connections!
307+
if ::ActiveRecord.version > 7.2
308+
::ActiveRecord::Base.connection_handler.clear_active_connections!
309+
else
310+
::ActiveRecord::Base.clear_active_connections!
311+
end
308312
end
309313

310314
def can_group?

0 commit comments

Comments
 (0)