diff options
author | Douwe Maan <douwe@gitlab.com> | 2018-12-10 17:37:42 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2018-12-10 17:37:42 +0300 |
commit | 80eebd8e33c5f2f26bc0fdd233d9d92c51edd242 (patch) | |
tree | 6cbfc605ce2bb61e73134a7cba00f068986f764f | |
parent | 42d37c1b06d7f4ab78c6230cfc535e26669e3360 (diff) | |
parent | d78272a13b50e912b1ac946da8eec2e75bc6eb41 (diff) |
Merge branch '55104-frozenerror-can-t-modify-frozen-string' into 'master'
Fix a frozen string error in app/mailers/notify.rb
Closes #55104
See merge request gitlab-org/gitlab-ce!23683
-rw-r--r-- | app/mailers/notify.rb | 2 | ||||
-rw-r--r-- | changelogs/unreleased/55104-frozenerror-can-t-modify-frozen-string.yml | 5 | ||||
-rw-r--r-- | spec/mailers/notify_spec.rb | 4 |
3 files changed, 8 insertions, 3 deletions
diff --git a/app/mailers/notify.rb b/app/mailers/notify.rb index 662f3e00047..88ad4c3e893 100644 --- a/app/mailers/notify.rb +++ b/app/mailers/notify.rb @@ -166,7 +166,7 @@ class Notify < BaseMailer headers['In-Reply-To'] = message_id(model) headers['References'] = [message_id(model)] - headers[:subject]&.prepend('Re: ') + headers[:subject] = "Re: #{headers[:subject]}" if headers[:subject] mail_thread(model, headers) end diff --git a/changelogs/unreleased/55104-frozenerror-can-t-modify-frozen-string.yml b/changelogs/unreleased/55104-frozenerror-can-t-modify-frozen-string.yml new file mode 100644 index 00000000000..994859b1d1d --- /dev/null +++ b/changelogs/unreleased/55104-frozenerror-can-t-modify-frozen-string.yml @@ -0,0 +1,5 @@ +--- +title: Fix a frozen string error in app/mailers/notify.rb +merge_request: 23683 +author: +type: fixed diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb index 150c00e4bfe..1d17aec0ded 100644 --- a/spec/mailers/notify_spec.rb +++ b/spec/mailers/notify_spec.rb @@ -28,8 +28,8 @@ describe Notify do end def have_referable_subject(referable, reply: false) - prefix = referable.project ? "#{referable.project.name} | " : '' - prefix.prepend('Re: ') if reply + prefix = (referable.project ? "#{referable.project.name} | " : '').freeze + prefix = "Re: #{prefix}" if reply suffix = "#{referable.title} (#{referable.to_reference})" |