Skip to content

Commit bc081a5

Browse files
authored
Merge pull request rails#47715 from adrianna-chang-shopify/ac-pg-fix-conn-param
PostgreSQL adapter uses :host instead of :hostname for connection params
2 parents 25f8d57 + b3d6c64 commit bc081a5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ def new_client(conn_params)
7272
raise ActiveRecord::NoDatabaseError.db_error(conn_params[:dbname])
7373
elsif conn_params && conn_params[:user] && error.message.include?(conn_params[:user])
7474
raise ActiveRecord::DatabaseConnectionError.username_error(conn_params[:user])
75-
elsif conn_params && conn_params[:hostname] && error.message.include?(conn_params[:hostname])
76-
raise ActiveRecord::DatabaseConnectionError.hostname_error(conn_params[:hostname])
75+
elsif conn_params && conn_params[:host] && error.message.include?(conn_params[:host])
76+
raise ActiveRecord::DatabaseConnectionError.hostname_error(conn_params[:host])
7777
else
7878
raise ActiveRecord::ConnectionNotEstablished, error.message
7979
end

0 commit comments

Comments
 (0)