Skip to content

Commit babe6b7

Browse files
committed
Clear the type_map as part of clear_cache!
1 parent 7997a7d commit babe6b7

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

lib/active_record/connection_adapters/oracle_enhanced_adapter.rb

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,11 @@ def reconnect! # :nodoc:
453453
@logger.warn "#{adapter_name} automatic reconnection failed: #{e.message}" if @logger
454454
end
455455

456+
def clear_cache!
457+
self.class.clear_type_map!
458+
super
459+
end
460+
456461
def reset!
457462
clear_cache!
458463
super
@@ -691,11 +696,14 @@ def check_version
691696
end
692697

693698
class << self
699+
def type_map
700+
@type_map ||= Type::TypeMap.new.tap { |m| initialize_type_map(m) }
701+
@type_map
702+
end
694703

695-
def type_map
696-
@type_map ||= Type::TypeMap.new.tap { |m| initialize_type_map(m) }
697-
@type_map
698-
end
704+
def clear_type_map!
705+
@type_map = nil
706+
end
699707

700708
private
701709
def initialize_type_map(m)
@@ -730,7 +738,6 @@ def initialize_type_map(m)
730738
end
731739
end
732740

733-
734741
def type_map
735742
self.class.type_map
736743
end

0 commit comments

Comments
 (0)