diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2019-07-11 05:55:25 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-11 05:55:25 +0900 |
commit | 2fa21fe736b08b5fbff173d518dacb5dbde11936 (patch) | |
tree | 14a6c7cbefbad5e3eee0b902d1f3c58cd037caa0 /activerecord | |
parent | 15748f6a052d4df68b6acf66456c181b42d9fe25 (diff) | |
parent | 50bb22da54dffa5450a1c8eba65425b8142466c9 (diff) | |
download | rails-2fa21fe736b08b5fbff173d518dacb5dbde11936.tar.gz rails-2fa21fe736b08b5fbff173d518dacb5dbde11936.tar.bz2 rails-2fa21fe736b08b5fbff173d518dacb5dbde11936.zip |
Merge pull request #36645 from Shopify/arel-dispatch-cache
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 |