Sha256: e423bb3f5783959f85332f863148303d7c000d2668992bca2d10d843125156ba
Contents?: true
Size: 843 Bytes
Versions: 5
Compression:
Stored size: 843 Bytes
Contents
module ConnectionManager module AbstractAdapterHelper def config @config end def using_em_adapter? (config[:adapter].match(/^em\_/) && defined?(EM) && EM::reactor_running?) end def readonly? (config[:readonly] == true) end def replicated? (!slave_keys.blank? || !master_keys.blank?) end def database_name config[:database] end def replication_keys(type=:slaves) return slave_keys if type == :slaves master_keys end def slave_keys slave_keys = [] slave_keys = config[:slaves].collect{|r| r.to_sym} if config[:slaves] slave_keys end def master_keys master_keys = [] master_keys = config[:masters].collect{|r| r.to_sym} if config[:masters] master_keys end end end
Version data entries
5 entries across 5 versions & 1 rubygems