# 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])
+ connection.sync_exec_params(sql_query, [user_id])
ensure
# Make sure the connection gets closed even if the query explodes.
connection.close()