Module: AdapterExtensions

Defined in:
lib/adapter_extensions/version.rb,
lib/adapter_extensions/base.rb

Overview

Source file identifying the version of AdapterExtensions in this package

Defined Under Namespace

Modules: AbstractAdapter, MysqlAdapter, PostgreSQLAdapter, SQLServerAdapter

Constant Summary collapse

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

:nodoc:

"1.0.0"

Class Method Summary collapse

Class Method Details

.load_from_connection_pool(connection_pool) ⇒ Object



15
16
17
# File 'lib/adapter_extensions/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 extensions for a specific database adapter



9
10
11
12
13
# File 'lib/adapter_extensions/base.rb', line 9

def self.require_adapter(adapter)
  require File.join(AdapterPath,"/abstract_adapter")
  specific_adapter = File.join(AdapterPath,"/#{adapter}_adapter")
  require specific_adapter if File.exists?(specific_adapter + '.rb')
end