Class: Switchman::SchemaCache

Inherits:
ActiveRecord::ConnectionAdapters::SchemaCache
  • Object
show all
Defined in:
lib/switchman/schema_cache.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pool) ⇒ SchemaCache

Returns a new instance of SchemaCache.



6
7
8
9
# File 'lib/switchman/schema_cache.rb', line 6

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

Instance Attribute Details

#poolObject (readonly)

Returns the value of attribute pool.



4
5
6
# File 'lib/switchman/schema_cache.rb', line 4

def pool
  @pool
end

Instance Method Details

#copy_values(other_cache) ⇒ Object



11
12
13
14
15
16
# File 'lib/switchman/schema_cache.rb', line 11

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