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



112
113
114
115
116
117
# File 'lib/stagehand/database.rb', line 112

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

.nameObject



119
120
121
# File 'lib/stagehand/database.rb', line 119

def self.name
  @probe_name || super
end