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
This commit is contained in:
Douwe Maan 2018-12-10 14:37:42 +00:00
commit 80eebd8e33
3 changed files with 8 additions and 3 deletions

View File

@ -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

View File

@ -0,0 +1,5 @@
---
title: Fix a frozen string error in app/mailers/notify.rb
merge_request: 23683
author:
type: fixed

View File

@ -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})"