module CsvFastImporter::DatabaseFactory
Build corresponding CsvFastImporter
database implementation based current adapter (fetched from DatabaseConnection
)
Constants
- DATABASES
Public Class Methods
build()
click to toggle source
# File lib/csv_fast_importer/database_factory.rb, line 13 def self.build adapter = CsvFastImporter::DatabaseConnection.adapter_name return DATABASES[adapter].new(CsvFastImporter::DatabaseConnection.base_connection) if DATABASES.has_key?(adapter) raise "Database adapter #{adapter} not supported by CsvFastImporter. Only #{DATABASES.keys.join(", ")} are supported" end