Skip to content

Commit cb82744

Browse files
authored
Merge pull request #2030 from yahonda/diag_jruby_6267
Implement ObjectSpace::WeakMap#values for JRuby
2 parents a349fe9 + b89ef06 commit cb82744

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

lib/active_record/connection_adapters/oracle_enhanced_adapter.rb

+15
Original file line numberDiff line numberDiff line change
@@ -773,3 +773,18 @@ def bind_string(name, value)
773773
module ActiveRecord
774774
autoload :OracleEnhancedProcedures, "active_record/connection_adapters/oracle_enhanced/procedures"
775775
end
776+
777+
# Workaround for https://github.com/jruby/jruby/issues/6267
778+
if RUBY_ENGINE == "jruby"
779+
require "jruby"
780+
781+
class org.jruby::RubyObjectSpace::WeakMap
782+
field_reader :map
783+
end
784+
785+
class ObjectSpace::WeakMap
786+
def values
787+
JRuby.ref(self).map.values.reject(&:nil?)
788+
end
789+
end
790+
end

0 commit comments

Comments
 (0)