Sha256: efe7a70cd94661a240b95e9ee2627561c8f86776571930b4ae976c5c506d0c99
Contents?: true
Size: 814 Bytes
Versions: 28
Compression:
Stored size: 814 Bytes
Contents
module ActiveRecord::Turntable class MasterShard < Shard def initialize(klass) (klass and klass.connection_pool) or raise MasterShardNotConnected, "connection_pool is nil" @klass = klass @name = 'master' end def connection_pool if ActiveRecord::Base == @klass ActiveRecord::Base.connection_pool else # use parentclass connection which is turntable disabled klass = @klass.superclass candidate_connection_pool = nil while !candidate_connection_pool if klass == ActiveRecord::Base or !klass.turntable_enabled? candidate_connection_pool = klass.connection_pool else klass = klass.superclass end end candidate_connection_pool end end end end
Version data entries
28 entries across 28 versions & 1 rubygems