diff options
author | Go MAEDA <maeda@farend.jp> | 2019-04-06 06:17:03 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2019-04-06 06:17:03 +0000 |
commit | 25ec4a936607ee876e6a9b25a2344c29b3beb905 (patch) | |
tree | ecd4de234013b45ae84ab8a0447ba880f9e11252 | |
parent | bc9de070df79ed8f812efad9ab84d4a0794594a5 (diff) | |
download | redmine-25ec4a936607ee876e6a9b25a2344c29b3beb905.tar.gz redmine-25ec4a936607ee876e6a9b25a2344c29b3beb905.zip |
Code cleanup: use safe navigation operator in app/models/mailer.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@18045 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | app/models/mailer.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/models/mailer.rb b/app/models/mailer.rb index 5ef10c1d7..c1eef53e4 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -632,7 +632,7 @@ class Mailer < ActionMailer::Base mail_from = Mail::Address.new(Setting.mail_from) if mail_from.display_name.blank? && mail_from.comments.blank? mail_from.display_name = - (@author && @author.logged?) ? @author.name : Setting.app_title + @author&.logged? ? @author.name : Setting.app_title end headers.reverse_merge! 'X-Mailer' => 'Redmine', @@ -653,13 +653,13 @@ class Mailer < ActionMailer::Base # Removes the author from the recipients and cc # if the author does not want to receive notifications # about what the author do - if @author && @author.logged? && @author.pref.no_self_notified + if @author&.logged? && @author.pref.no_self_notified addresses = @author.mails headers[:to] -= addresses if headers[:to].is_a?(Array) headers[:cc] -= addresses if headers[:cc].is_a?(Array) end - if @author && @author.logged? + if @author&.logged? redmine_headers 'Sender' => @author.login end |