diff options
author | Jean Boussier <jean.boussier@gmail.com> | 2019-07-10 11:54:32 +0200 |
---|---|---|
committer | Jean Boussier <jean.boussier@gmail.com> | 2019-07-10 11:54:32 +0200 |
commit | 50bb22da54dffa5450a1c8eba65425b8142466c9 (patch) | |
tree | 29b0424175042223a50c55d64fece0bb8d3d2b62 /activerecord | |
parent | 60809e0e1f36da730d0765a1dd781c52366053fb (diff) | |
download | rails-50bb22da54dffa5450a1c8eba65425b8142466c9.tar.gz rails-50bb22da54dffa5450a1c8eba65425b8142466c9.tar.bz2 rails-50bb22da54dffa5450a1c8eba65425b8142466c9.zip |
Share the Arel dispatch cache between connections
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/arel/visitors/visitor.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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 |