Sha256: 32d2598669e1f376dce9b48e1664c1bf370fdfc3de82ed7bed17fbdff70a387c
Contents?: true
Size: 468 Bytes
Versions: 2
Compression:
Stored size: 468 Bytes
Contents
require 'active_record' require 'yaml' db_type = ENV.fetch('DATABASE_TYPE', 'sqlite') db_config = YAML.load_file('features/db/database.yml').fetch(db_type) if db_type == 'mysql' ActiveRecord::Base.establish_connection(db_config.except('database')).with_connection do |c| c.execute p %{CREATE DATABASE IF NOT EXISTS #{db_config.fetch('database')}} end end ActiveRecord::Base.establish_connection(db_config).with_connection do |c| c.execute %{ SELECT 1} end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
acts_as_account-3.5.0 | features/support/db.rb |
acts_as_account-3.4.2 | features/support/db.rb |