From 3f0d5eaf6fc6b9d75bbbae5813a246330509fd22 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 25 Jun 2017 19:24:20 +0000 Subject: [PATCH] Refactor "multiple_values_detail" struct creation (#26130). git-svn-id: http://svn.redmine.org/redmine/trunk@16707 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/issues_helper.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index 020fed732..f86776040 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -347,6 +347,8 @@ module IssuesHelper end end + MultipleValuesDetail = Struct.new(:property, :prop_key, :custom_field, :old_value, :value) + # Returns the textual representation of a journal details # as an array of strings def details_to_strings(details, no_html=false, options={}) @@ -370,15 +372,14 @@ module IssuesHelper strings << show_detail(detail, no_html, options) end if values_by_field.present? - multiple_values_detail = Struct.new(:property, :prop_key, :custom_field, :old_value, :value) values_by_field.each do |field, changes| if changes[:added].any? - detail = multiple_values_detail.new('cf', field.id.to_s, field) + detail = MultipleValuesDetail.new('cf', field.id.to_s, field) detail.value = changes[:added] strings << show_detail(detail, no_html, options) end if changes[:deleted].any? - detail = multiple_values_detail.new('cf', field.id.to_s, field) + detail = MultipleValuesDetail.new('cf', field.id.to_s, field) detail.old_value = changes[:deleted] strings << show_detail(detail, no_html, options) end -- 2.39.5