Sha256: 5877f29975f661341b99fa8a0b74b6aa41155e90b59f284fb30a4ee911471b51

Contents?: true

Size: 742 Bytes

Versions: 3

Compression:

Stored size: 742 Bytes

Contents

module ActiveRecord::Import
  AdapterPath = File.join File.expand_path(File.dirname(__FILE__)), "active_record/adapters"

  def self.base_adapter(adapter)
    case adapter
    when 'mysqlspatial' then 'mysql'
    when 'spatialite' then 'sqlite3'
    when 'postgis' then 'postgresql'
    else adapter
    end
  end

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


this_dir = File.dirname(__FILE__)
require File.join(this_dir, "import")
require File.join(this_dir, "active_record/adapters/abstract_adapter")
require File.join(this_dir, "synchronize")

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
Empact-activerecord-import-0.4.3 lib/activerecord-import/base.rb
Empact-activerecord-import-0.4.1 lib/activerecord-import/base.rb
Empact-activerecord-import-0.4.0 lib/activerecord-import/base.rb