From d4e021adbc61b41af308f69fbf09fe24e29f217f Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Wed, 4 Aug 2021 11:59:45 +0100 Subject: [PATCH 1/2] Replace Addressable::URI Issue loading these methods in production even though they work fine in development and test environments. It's possible to do the same using Ruby core methods instead. --- app/models/survey.rb | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/models/survey.rb b/app/models/survey.rb index ba37e5ac10..4ba447eb0d 100644 --- a/app/models/survey.rb +++ b/app/models/survey.rb @@ -25,11 +25,14 @@ def initialize(public_body) def url return Survey.url if user_too_identifiable? - Addressable::URI.parse(Survey.url).tap do |url| - url.query_values = (url.query_values || {}).merge( - authority_id: public_body.to_param - ) - end.to_s + uri = URI(Survey.url) + + new_query = Hash[URI.decode_www_form(uri.query.to_s)].merge( + authority_id: public_body.to_param + ) + uri.query = URI.encode_www_form(new_query) + + uri.to_s end protected From 9de50e9e830a9df40be5d80a95fab05fdace7d69 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Wed, 4 Aug 2021 12:52:30 +0100 Subject: [PATCH 2/2] Bump Alaveteli to 0.39.1.3 --- config/initializers/alaveteli.rb | 2 +- doc/CHANGES.md | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/config/initializers/alaveteli.rb b/config/initializers/alaveteli.rb index 266b99d96f..9ea6258c3e 100644 --- a/config/initializers/alaveteli.rb +++ b/config/initializers/alaveteli.rb @@ -10,7 +10,7 @@ load "util.rb" # Application version -ALAVETELI_VERSION = '0.39.1.2' +ALAVETELI_VERSION = '0.39.1.3' # Add new inflection rules using the following format # (all these examples are active by default): diff --git a/doc/CHANGES.md b/doc/CHANGES.md index d7c886b6b9..b80bafbe83 100644 --- a/doc/CHANGES.md +++ b/doc/CHANGES.md @@ -1,3 +1,9 @@ +# 0.39.1.3 + +## Highlighted Features + +* Fix broken alert-survey script (Graeme Porteous) + # 0.39.1.2 ## Highlighted Features