From 36a9df2c4ff0664a156181ecf7c8b677571ef705 Mon Sep 17 00:00:00 2001 From: Mihai Muntenas Date: Fri, 13 Sep 2024 10:16:04 +0200 Subject: [PATCH] Fix version check in ActiveRecord adapter Fix version check in ActiveRecord adapter: the "target" version for comparison needs to be a string. Fixes: ArgumentError: comparison of Gem::Version with 7.2 failed --- lib/graphiti/adapters/active_record.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/graphiti/adapters/active_record.rb b/lib/graphiti/adapters/active_record.rb index ee66a8ef..8a7a5ffe 100644 --- a/lib/graphiti/adapters/active_record.rb +++ b/lib/graphiti/adapters/active_record.rb @@ -304,7 +304,7 @@ def destroy(model_instance) end def close - if ::ActiveRecord.version > 7.2 + if ::ActiveRecord.version > '7.2' ::ActiveRecord::Base.connection_handler.clear_active_connections! else ::ActiveRecord::Base.clear_active_connections!