Sha256: dc2cd99de0c73686ab6d19ba66d7bf77bab5c945bd168c602f1035437b024db6

Contents?: true

Size: 504 Bytes

Versions: 23

Compression:

Stored size: 504 Bytes

Contents

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

23 entries across 23 versions & 1 rubygems

Version Path
switchman-1.13.0 lib/switchman/schema_cache.rb
switchman-1.12.16 lib/switchman/schema_cache.rb
switchman-1.12.15 lib/switchman/schema_cache.rb