Class: Slavery::ConnectionHolder

Inherits:
ActiveRecord::Base show all
Defined in:
lib/slavery/connection_holder.rb

Class Method Summary collapse

Methods inherited from ActiveRecord::Base

connection, connection_without_slavery, on_slave

Class Method Details

.activateObject

for delayed activation

Raises:



7
8
9
10
11
# File 'lib/slavery/connection_holder.rb', line 7

def activate
  spec = ActiveRecord::Base.configurations[Slavery.spec_key]
  raise Error.new('Slavery.spec_key invalid!') if spec.nil?
  establish_connection spec
end