Fix PG.connect keyword arguments deprecation warning on ruby 2.7
This commit is contained in:
parent
c2ce4d6e14
commit
c3a0e326e8
|
@ -1,3 +1,9 @@
|
|||
* Fix PG.connect keyword arguments deprecation warning on ruby 2.7
|
||||
|
||||
Fixes #44307.
|
||||
|
||||
*Nikita Vasilevsky*
|
||||
|
||||
* Fix dropping DB connections after serialization failures and deadlocks.
|
||||
|
||||
Prior to 6.1.4, serialization failures and deadlocks caused rollbacks to be
|
||||
|
|
|
@ -75,7 +75,7 @@ module ActiveRecord
|
|||
|
||||
class << self
|
||||
def new_client(conn_params)
|
||||
PG.connect(conn_params)
|
||||
PG.connect(**conn_params)
|
||||
rescue ::PG::Error => error
|
||||
if conn_params && conn_params[:dbname] && error.message.include?(conn_params[:dbname])
|
||||
raise ActiveRecord::NoDatabaseError.db_error(conn_params[:dbname])
|
||||
|
@ -281,7 +281,7 @@ module ActiveRecord
|
|||
def initialize(connection, logger, connection_parameters, config)
|
||||
super(connection, logger, config)
|
||||
|
||||
@connection_parameters = connection_parameters
|
||||
@connection_parameters = connection_parameters || {}
|
||||
|
||||
# @local_tz is initialized as nil to avoid warnings when connect tries to use it
|
||||
@local_tz = nil
|
||||
|
|
Loading…
Reference in New Issue