Module: ActiveRecord::Import

Defined in:
lib/activerecord-import/import.rb,
lib/activerecord-import/base.rb

Overview

:nodoc:

Defined Under Namespace

Modules: AbstractAdapter, ConnectionAdapters, ImportSupport, MysqlAdapter, OnDuplicateKeyUpdateSupport, PostgreSQLAdapter, Sqlite3Adapter Classes: Result

Constant Summary collapse

AdapterPath =
File.join File.expand_path(File.dirname(__FILE__)), "/active_record/adapters"

Class Method Summary collapse

Class Method Details

.load_from_connection_pool(connection_pool) ⇒ Object

Loads the import functionality for the passed in ActiveRecord connection



15
16
17
# File 'lib/activerecord-import/base.rb', line 15

def self.load_from_connection_pool(connection_pool)
  require_adapter connection_pool.spec.config[:adapter]
end

.require_adapter(adapter) ⇒ Object

Loads the import functionality for a specific database adapter



9
10
11
12
# File 'lib/activerecord-import/base.rb', line 9

def self.require_adapter(adapter)
  require File.join(AdapterPath,"/abstract_adapter")
  require File.join(AdapterPath,"/#{adapter}_adapter")
end