Sha256: 503e9c4d270422ff2b44067c233862a93215f16d21da1992bb4aaa1540eb2593
Contents?: true
Size: 742 Bytes
Versions: 16
Compression:
Stored size: 742 Bytes
Contents
# frozen_string_literal: true module Switchman class SchemaCache < ::ActiveRecord::ConnectionAdapters::SchemaCache delegate :connection, to: :pool attr_reader :pool SHARED_IVS = %i{@columns @columns_hash @primary_keys @data_sources @indexes}.freeze def initialize(pool) @pool = pool super(nil) end def copy_values(other_cache) SHARED_IVS.each do |iv| instance_variable_get(iv).replace(other_cache.instance_variable_get(iv)) end end def copy_references(other_cache) # use the same cached values but still fall back to the correct pool SHARED_IVS.each do |iv| instance_variable_set(iv, other_cache.instance_variable_get(iv)) end end end end
Version data entries
16 entries across 16 versions & 1 rubygems