Class: ActiveRecord::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/em-synchrony/active_record/connection_adapters/em_mysql2_adapter.rb

Class Method Summary collapse

Class Method Details

.em_mysql2_connection(config) ⇒ Object



12
13
14
15
16
# File 'lib/em-synchrony/active_record/connection_adapters/em_mysql2_adapter.rb', line 12

def self.em_mysql2_connection(config)
  client = Mysql2::EM::Client.new(config.symbolize_keys)
  options = [config[:host], config[:username], config[:password], config[:database], config[:port], config[:socket], 0]
  ConnectionAdapters::Mysql2Adapter.new(client, logger, options, config)
end