Skip to content

Commit

Permalink
Do not implement existing values to weakmap
Browse files Browse the repository at this point in the history
  • Loading branch information
jlahtinen committed Mar 11, 2024
1 parent 1728ac3 commit 94bf9dc
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions lib/active_record/connection_adapters/oracle_enhanced_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -779,13 +779,15 @@ module ActiveRecord
if RUBY_ENGINE == "jruby"
require "jruby"

class org.jruby::RubyObjectSpace::WeakMap
field_reader :map
end
unless ObjectSpace::WeakMap.new.respond_to? :values
class org.jruby::RubyObjectSpace::WeakMap
field_reader :map
end

class ObjectSpace::WeakMap
def values
JRuby.ref(self).map.values.reject(&:nil?)
class ObjectSpace::WeakMap
def values
JRuby.ref(self).map.values.reject(&:nil?)
end
end
end
end
end

0 comments on commit 94bf9dc

Please sign in to comment.