From 50bb22da54dffa5450a1c8eba65425b8142466c9 Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Wed, 10 Jul 2019 11:54:32 +0200 Subject: Share the Arel dispatch cache between connections --- activerecord/lib/arel/visitors/visitor.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord') diff --git a/activerecord/lib/arel/visitors/visitor.rb b/activerecord/lib/arel/visitors/visitor.rb index d65ac820bc..9066307aed 100644 --- a/activerecord/lib/arel/visitors/visitor.rb +++ b/activerecord/lib/arel/visitors/visitor.rb @@ -15,7 +15,7 @@ module Arel # :nodoc: all attr_reader :dispatch def self.dispatch_cache - Hash.new do |hash, klass| + @dispatch_cache ||= Hash.new do |hash, klass| hash[klass] = "visit_#{(klass.name || '').gsub('::', '_')}" end end -- cgit v1.2.3