def adapter_config
      default_config = {}
      default_config['database'] = guess_database_name
      if Env.gem?('pg')
        default_config['adapter'] = 'postgresql'
        default_config['username'] = 'postgres' if Env.travis?
        default_config['password'] = ''
        user_config = @yaml_config['postgresql'] || @yaml_config['postgres'] || @yaml_config['pg'] || {}
      elsif Env.gem?('mysql2')
        default_config['adapter'] = 'mysql2'
        default_config['username'] = 'travis' if Env.travis?
        default_config['encoding'] = 'utf8'
        user_config = (@yaml_config['mysql'] || @yaml_config['mysql2']) || {}
      elsif Env.gem?('sqlite3')
        default_config['adapter'] = 'sqlite3'
        default_config['database'] = ':memory:'
        user_config = (@yaml_config['sqlite'] || @yaml_config['sqlite3']) || {}
      else
        raise UnknownAdapter, "Unknown database type. Either 'pg', 'mysql2', or 'sqlite3' gem should be in your current bundle."
      end
      default_config.merge(user_config)
    end
def adapter_config
      default_config = {}
      default_config['database'] = guess_database_name
      if Env.gem?('pg')
        default_config['adapter'] = 'postgresql'
        default_config['username'] = 'postgres' if Env.travis?
        default_config['password'] = ''
        user_config = @yaml_config['postgresql'] || @yaml_config['postgres'] || @yaml_config['pg'] || {}
      elsif Env.gem?('mysql2')
        default_config['adapter'] = 'mysql2'
        default_config['username'] = 'travis' if Env.travis?
        default_config['encoding'] = 'utf8'
        user_config = (@yaml_config['mysql'] || @yaml_config['mysql2']) || {}
      elsif Env.gem?('sqlite3')
        default_config['adapter'] = 'sqlite3'
        default_config['database'] = ':memory:'
        user_config = (@yaml_config['sqlite'] || @yaml_config['sqlite3']) || {}
      else
        raise UnknownAdapter, "Unknown database type. Either 'pg', 'mysql2', or 'sqlite3' gem should be in your current bundle."
      end
      default_config.merge(user_config)
    end
Returns a hash of ActiveRecord adapter options for the currently activated database gem.