Class: Foreigner::Adapter

Inherits:
Object
  • Object
show all
Defined in:
lib/foreigner/adapter.rb

Class Method Summary collapse

Class Method Details

.configured_nameObject



17
18
19
# File 'lib/foreigner/adapter.rb', line 17

def configured_name
  ActiveRecord::Base.connection_pool.spec.config[:adapter]
end

.load!Object



11
12
13
14
15
# File 'lib/foreigner/adapter.rb', line 11

def load!
  if registered.key?(configured_name)
    require registered[configured_name]
  end
end

.register(adapter_name, file_name) ⇒ Object



7
8
9
# File 'lib/foreigner/adapter.rb', line 7

def register(adapter_name, file_name)
  registered[adapter_name] = file_name
end