From c75dba701d446c62653a43e147e515aa4fb00d44 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Tue, 7 Dec 2021 12:07:48 +0100 Subject: [PATCH 1/2] lib: replace URI.encode by CGI.escape URI.encode was removed in Ruby 3. Fix an error when adding a phone number to a Helpscout ticket. --- app/lib/helpscout/api.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/lib/helpscout/api.rb b/app/lib/helpscout/api.rb index 127002854..c0538c7a9 100644 --- a/app/lib/helpscout/api.rb +++ b/app/lib/helpscout/api.rb @@ -43,7 +43,7 @@ class Helpscout::API end def add_phone_number(email, phone) - query = URI.encode("(email:#{email})") + query = CGI.escape("(email:#{email})") response = call_api(:get, "#{CUSTOMERS}?mailbox=#{user_support_mailbox_id}&query=#{query}") if response.success? body = parse_response_body(response) From a5b3bc1e79f2e9db4098b884223a3fc199a0efda Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Tue, 7 Dec 2021 16:15:43 +0100 Subject: [PATCH 2/2] fix(task): fix scope in set_dossiers_processed_at --- .../deployment/20211110093332_set_dossiers_processed_at.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/deployment/20211110093332_set_dossiers_processed_at.rake b/lib/tasks/deployment/20211110093332_set_dossiers_processed_at.rake index 335d7fbe2..7cb0e3697 100644 --- a/lib/tasks/deployment/20211110093332_set_dossiers_processed_at.rake +++ b/lib/tasks/deployment/20211110093332_set_dossiers_processed_at.rake @@ -3,7 +3,7 @@ namespace :after_party do task set_dossiers_processed_at: :environment do puts "Running deploy task 'set_dossiers_processed_at'" - dossiers = Dossier.termine.includes(:traitement) + dossiers = Dossier.with_discarded.state_termine.includes(:traitement) progress = ProgressReport.new(dossiers.count) dossiers.find_each do |dossier|