Sha256: 34ea4feb4ef8488ff399ecfef2d192e042ba564c7d74fd644a3de902c780e606

Contents?: true

Size: 478 Bytes

Versions: 11

Compression:

Stored size: 478 Bytes

Contents

require 'active_support/logger'

module ARTest
  def self.connection_name
    ENV['ARCONN'] || config['default_connection']
  end

  def self.connection_config
    config['connections'][connection_name]
  end

  def self.connect
    puts "Using #{connection_name}"
    ActiveRecord::Base.logger = ActiveSupport::Logger.new("debug.log", 0, 100 * 1024 * 1024)
    ActiveRecord::Base.configurations = connection_config
    ActiveRecord::Base.establish_connection :arunit
  end
end

Version data entries

11 entries across 11 versions & 3 rubygems

Version Path
activerecord-mysql-awesome-0.0.9 test/support/connection.rb
activerecord-mysql-awesome-0.0.8 test/support/connection.rb
activerecord-mysql-awesome-0.0.7 test/support/connection.rb
activerecord-mysql-awesome-0.0.6 test/support/connection.rb
activerecord-mysql-awesome-0.0.5 test/support/connection.rb
activerecord-postgresql-expression-0.0.2 test/support/connection.rb
activerecord-postgresql-expression-0.0.1 test/support/connection.rb
activerecord-mysql-comment-0.0.1 test/support/connection.rb
activerecord-mysql-awesome-0.0.4 test/support/connection.rb
activerecord-mysql-awesome-0.0.3 test/support/connection.rb
activerecord-mysql-awesome-0.0.2 test/support/connection.rb