Skip to content

Commit 0bd325e

Browse files
authored
Merge pull request rails#28199 from kirs/ar-test-connection
Handle non-existing $ARCONN
2 parents cbbbbcc + 4846eee commit 0bd325e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

activerecord/test/support/connection.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ def self.connection_name
1010
end
1111

1212
def self.connection_config
13-
config["connections"][connection_name]
13+
config.fetch("connections").fetch(connection_name) do
14+
puts "Connection #{connection_name.inspect} not found. Available connections: #{config['connections'].keys.join(', ')}"
15+
exit 1
16+
end
1417
end
1518

1619
def self.connect

0 commit comments

Comments
 (0)