diff options
author | gfyoung <gfyoung17+gitlab@gmail.com> | 2018-08-15 21:45:57 +0000 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-08-15 21:45:57 +0000 |
commit | 8184ce7fb71c84f2706fc5221cea17a940ebe0eb (patch) | |
tree | 5344d9a51a52cbf0c2a593743445f5271e6e9552 /app/mailers/notify.rb | |
parent | 3a8e1fe9372dca597fee8f69a0ffc9c9780e1cbe (diff) | |
download | gitlab-ce-8184ce7fb71c84f2706fc5221cea17a940ebe0eb.tar.gz |
Enable frozen in app/mailers/**/*.rb
Diffstat (limited to 'app/mailers/notify.rb')
-rw-r--r-- | app/mailers/notify.rb | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/app/mailers/notify.rb b/app/mailers/notify.rb index 0e1e39501f5..f4eeb85270e 100644 --- a/app/mailers/notify.rb +++ b/app/mailers/notify.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Notify < BaseMailer include ActionDispatch::Routing::PolymorphicRoutes include GitlabRoutingHelper @@ -92,12 +94,14 @@ class Notify < BaseMailer # >> subject('Lorem ipsum', 'Dolor sit amet') # => "Lorem ipsum | Dolor sit amet" def subject(*extra) - subject = "" - subject << "#{@project.name} | " if @project - subject << "#{@group.name} | " if @group - subject << extra.join(' | ') if extra.present? - subject << " | #{Gitlab.config.gitlab.email_subject_suffix}" if Gitlab.config.gitlab.email_subject_suffix.present? - subject + subject = [] + + subject << @project.name if @project + subject << @group.name if @group + subject.concat(extra) if extra.present? + subject << Gitlab.config.gitlab.email_subject_suffix if Gitlab.config.gitlab.email_subject_suffix.present? + + subject.join(' | ') end # Return a string suitable for inclusion in the 'Message-Id' mail header. |