Exception: ActiveRecord::ConnectionNotDefined

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

Overview

Raised when a database connection pool is requested but has not been defined.

Instance Attribute Summary collapse

Attributes inherited from AdapterError

#connection_pool

Instance Method Summary collapse

Methods inherited from ConnectionNotEstablished

#set_pool

Constructor Details

#initialize(message = nil, connection_name: nil, role: nil, shard: nil) ⇒ ConnectionNotDefined

Returns a new instance of ConnectionNotDefined.



90
91
92
93
94
95
# File 'lib/active_record/errors.rb', line 90

def initialize(message = nil, connection_name: nil, role: nil, shard: nil)
  super(message)
  @connection_name = connection_name
  @role = role
  @shard = shard
end

Instance Attribute Details

#connection_nameObject (readonly)

Returns the value of attribute connection_name.



97
98
99
# File 'lib/active_record/errors.rb', line 97

def connection_name
  @connection_name
end

#roleObject (readonly)

Returns the value of attribute role.



97
98
99
# File 'lib/active_record/errors.rb', line 97

def role
  @role
end

#shardObject (readonly)

Returns the value of attribute shard.



97
98
99
# File 'lib/active_record/errors.rb', line 97

def shard
  @shard
end