simplify code

pull/7837/head
ulferts 5 years ago
parent 67e3a7a15a
commit 7b8600b8dc
No known key found for this signature in database
GPG Key ID: A205708DE1284017
  1. 8
      app/services/notifications/journal_wp_mail_service.rb

@ -67,10 +67,10 @@ class Notifications::JournalWPMailService
potential_text << journal.notes if journal.try(:notes)
%i[description subject].each do |field|
if journal.details[field].try(:any?)
from = journal.details[field].first
to = journal.details[field].second
potential_text << "\n" + Redmine::Helpers::Diff.new(to, from).additions.join(' ')
details = journal.details[field]
if details.present?
potential_text << "\n" + Redmine::Helpers::Diff.new(*details).additions.join(' ')
end
end
potential_text

Loading…
Cancel
Save