Class: Stagehand::Database::Probe

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/stagehand/database.rb

Overview

CLASSES

Direct Known Subclasses

ProductionProbe, StagingProbe

Class Method Summary collapse

Class Method Details

.init_connection(connection_name) ⇒ Object

We fake the class name so we can create a connection pool with the desired connection name instead of the name of the class



124
125
126
127
128
129
# File 'lib/stagehand/database.rb', line 124

def self.init_connection(connection_name)
  @probe_name = connection_name
  establish_connection(connection_name)
ensure
  @probe_name = nil
end

.nameObject



131
132
133
# File 'lib/stagehand/database.rb', line 131

def self.name
  @probe_name || super
end