Sha256: 81197a9285051bfe56f7095b1bf5bc51472a380004df1a63557cd1300d73e22a
Contents?: true
Size: 744 Bytes
Versions: 7
Compression:
Stored size: 744 Bytes
Contents
print "Using native MySQL\n" require 'fileutils' require 'logger' require 'adapter_helper/mysql' require 'active_record' log_path = File.expand_path(File.join(File.dirname(__FILE__), %w[.. .. .. log])) FileUtils.mkdir_p log_path ActiveRecord::Base.logger = Logger.new("#{log_path}/debug.log") def connection_string options = {} options['u'] = SPEC['username'] if SPEC['username'] options['p'] = SPEC['password'] if SPEC['password'] options['S'] = SPEC['sock'] if SPEC['sock'] options.map { |key, value| "-#{key} #{value}" }.join(" ") end # Adapter config setup in locals/database_connections.rb connection_options = AdapterHelper::MySQL.load_connection_from_env ActiveRecord::Base.establish_connection(connection_options)
Version data entries
7 entries across 7 versions & 1 rubygems