module ActiveRecord::Import

def self.load_from_connection(connection)

Loads the import functionality for the passed in ActiveRecord connection
def self.load_from_connection(connection)
  import_adapter = "ActiveRecord::Import::#{connection.class.name.demodulize}::InstanceMethods"
  unless connection.class.ancestors.map(&:name).include?(import_adapter)
    config = connection.instance_variable_get :@config
    require_adapter config[:adapter]
  end
end

def self.require_adapter(adapter)

Loads the import functionality for a specific database adapter
def self.require_adapter(adapter)
  require File.join(AdapterPath,"/abstract_adapter")
  require File.join(AdapterPath,"/#{adapter}_adapter")
end