summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2019-11-08 14:53:11 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2019-11-08 14:53:11 +0000
commit7bcb299a3c8ad2a1ae3778482db954556d8417c0 (patch)
treec5279313b79cfbeeaf58bdfb9f3ace6e1c6198f8 /app
parent2870220c8d9ebd22a4a2a3c2698b037b3d075691 (diff)
downloadredmine-7bcb299a3c8ad2a1ae3778482db954556d8417c0.tar.gz
redmine-7bcb299a3c8ad2a1ae3778482db954556d8417c0.zip
cleanup: rubocop: fix Style/MultilineTernaryOperator in app/models/mail_handler.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@18960 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/models/mail_handler.rb20
1 files changed, 12 insertions, 8 deletions
diff --git a/app/models/mail_handler.rb b/app/models/mail_handler.rb
index 7f03591e2..eccc93a2a 100644
--- a/app/models/mail_handler.rb
+++ b/app/models/mail_handler.rb
@@ -344,10 +344,12 @@ class MailHandler < ActionMailer::Base
@keywords[attr]
else
@keywords[attr] = begin
- override = options.key?(:override) ?
- options[:override] :
- (handler_options[:allow_override] & [attr.to_s.downcase.gsub(/\s+/, '_'), 'all']).present?
-
+ override =
+ if options.key?(:override)
+ options[:override]
+ else
+ (handler_options[:allow_override] & [attr.to_s.downcase.gsub(/\s+/, '_'), 'all']).present?
+ end
if override && (v = extract_keyword!(cleaned_up_text_body, attr, options[:format]))
v
elsif !handler_options[:issue][attr].blank?
@@ -503,11 +505,13 @@ class MailHandler < ActionMailer::Base
parts.reject! do |part|
part.attachment?
end
-
parts.map do |p|
- body_charset = Mail::RubyVer.respond_to?(:pick_encoding) ?
- Mail::RubyVer.pick_encoding(p.charset).to_s : p.charset
-
+ body_charset =
+ if Mail::RubyVer.respond_to?(:pick_encoding)
+ Mail::RubyVer.pick_encoding(p.charset).to_s
+ else
+ p.charset
+ end
body = Redmine::CodesetUtil.to_utf8(p.body.decoded, body_charset)
# convert html parts to text
p.mime_type == 'text/html' ? self.class.html_body_to_text(body) : self.class.plain_text_body_to_text(body)