Sha256: b0037e85d6a462883775c10817c559852f40c6860264823de3fadcd26b045a5c

Contents?: true

Size: 535 Bytes

Versions: 6

Compression:

Stored size: 535 Bytes

Contents

# frozen_string_literal: true

module Switchman
  class SchemaCache < ::ActiveRecord::ConnectionAdapters::SchemaCache
    delegate :connection, to: :pool
    attr_reader :pool

    def initialize(pool)
      @pool = pool
      super(nil)
    end

    def copy_values(other_cache)
      # use the same cached values but still fall back to the correct pool
      [:@columns, :@columns_hash, :@primary_keys, :@data_sources].each do |iv|
        instance_variable_set(iv, other_cache.instance_variable_get(iv))
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
switchman-2.0.8 lib/switchman/schema_cache.rb
switchman-2.0.7 lib/switchman/schema_cache.rb
switchman-2.0.6 lib/switchman/schema_cache.rb
switchman-2.0.5 lib/switchman/schema_cache.rb
switchman-2.0.3 lib/switchman/schema_cache.rb
switchman-2.0.2 lib/switchman/schema_cache.rb