Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

simplify code

ulferts7b8600b8dc48
diff --git a/app/services/notifications/journal_wp_mail_service.rb b/app/services/notifications/journal_wp_mail_service.rb
index cb8752cb493..0561f869bb3 100644
--- a/app/services/notifications/journal_wp_mail_service.rb
+++ b/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