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-2.0.1 lib/switchman/schema_cache.rb
switchman-2.0.0 lib/switchman/schema_cache.rb
switchman-1.16.0 lib/switchman/schema_cache.rb
switchman-1.15.2 lib/switchman/schema_cache.rb
switchman-1.15.1 lib/switchman/schema_cache.rb
switchman-1.15.0 lib/switchman/schema_cache.rb
switchman-1.14.10 lib/switchman/schema_cache.rb
switchman-1.14.9 lib/switchman/schema_cache.rb
switchman-1.14.8 lib/switchman/schema_cache.rb
switchman-1.14.7 lib/switchman/schema_cache.rb
switchman-1.14.6 lib/switchman/schema_cache.rb
switchman-1.14.5 lib/switchman/schema_cache.rb
switchman-1.14.4 lib/switchman/schema_cache.rb
switchman-1.14.3 lib/switchman/schema_cache.rb
switchman-1.14.2 lib/switchman/schema_cache.rb
switchman-1.14.1 lib/switchman/schema_cache.rb
switchman-1.14.0 lib/switchman/schema_cache.rb
switchman-1.13.3 lib/switchman/schema_cache.rb
switchman-1.13.2 lib/switchman/schema_cache.rb
switchman-1.13.1 lib/switchman/schema_cache.rb