From 4c476505b76de66a20cc55fbcf325715aca654d9 Mon Sep 17 00:00:00 2001 From: Thomas Steinhausen <27787+iaddict@users.noreply.github.com> Date: Wed, 21 Feb 2024 17:38:29 +0100 Subject: [PATCH] Enhance workaround for WeakMap with new jruby versions Since jruby 9.4.6.0 the missing methods on ObjectSpace::WeakMap have been implemented. See: https://github.com/jruby/jruby/pull/6683 --- .../connection_adapters/oracle_enhanced_adapter.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb b/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb index eca568235..8d6fbeb0f 100644 --- a/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb +++ b/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb @@ -825,7 +825,7 @@ module ActiveRecord end # Workaround for https://github.com/jruby/jruby/issues/6267 -if RUBY_ENGINE == "jruby" +if defined?(JRUBY_VERSION) && Gem::Version.new(JRUBY_VERSION) < Gem::Version.new("9.4.6.0") require "jruby" class org.jruby::RubyObjectSpace::WeakMap