From: Michael Orlitzky Date: Sat, 25 Jul 2020 01:15:40 +0000 (-0400) Subject: lib: replace two PG::Connection.connect with PG::Connection.new. X-Git-Tag: 0.0.4~1 X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=adaab0ea0fb8ae690ac7c7d5a69a079467252767;p=mailshears.git lib: replace two PG::Connection.connect with PG::Connection.new. --- diff --git a/lib/common/roundcube_plugin.rb b/lib/common/roundcube_plugin.rb index a4300c4..b66c9f6 100644 --- a/lib/common/roundcube_plugin.rb +++ b/lib/common/roundcube_plugin.rb @@ -47,7 +47,7 @@ module RoundcubePlugin def list_users() usernames = [] - connection = PG::Connection.connect(@db_hash) + connection = PG::Connection.new(@db_hash) sql_query = 'SELECT username FROM users;' diff --git a/lib/rm/plugins/roundcube.rb b/lib/rm/plugins/roundcube.rb index c7ccaa4..cb55af7 100644 --- a/lib/rm/plugins/roundcube.rb +++ b/lib/rm/plugins/roundcube.rb @@ -29,7 +29,7 @@ class RoundcubeRm # records associated with user_id too. sql_query = 'DELETE FROM users WHERE user_id = $1::int;' - connection = PG::Connection.connect(@db_hash) + connection = PG::Connection.new(@db_hash) begin connection.query(sql_query, [user_id])