Exception: ActiveRecord::ConnectionNotEstablished

Inherits:
AdapterError show all
Defined in:
lib/active_record/errors.rb

Overview

Raised when connection to the database could not been established (for example when ActiveRecord::Base.connection= is given a nil object).

Instance Attribute Summary

Attributes inherited from AdapterError

#connection_pool

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, connection_pool: nil) ⇒ ConnectionNotEstablished

Returns a new instance of ConnectionNotEstablished.



72
73
74
# File 'lib/active_record/errors.rb', line 72

def initialize(message = nil, connection_pool: nil)
  super(message, connection_pool: connection_pool)
end

Instance Method Details

#set_pool(connection_pool) ⇒ Object



76
77
78
79
80
81
82
# File 'lib/active_record/errors.rb', line 76

def set_pool(connection_pool)
  unless @connection_pool
    @connection_pool = connection_pool
  end

  self
end