diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-06-25 19:24:20 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-06-25 19:24:20 +0000 |
commit | 3f0d5eaf6fc6b9d75bbbae5813a246330509fd22 (patch) | |
tree | a571ce1ac8bed42fc512900b7b9c6aa3b14f6216 | |
parent | 55f51cd6937dd79ec2dae150d872dc7edd45e551 (diff) | |
download | redmine-3f0d5eaf6fc6b9d75bbbae5813a246330509fd22.tar.gz redmine-3f0d5eaf6fc6b9d75bbbae5813a246330509fd22.zip |
Refactor "multiple_values_detail" struct creation (#26130).
git-svn-id: http://svn.redmine.org/redmine/trunk@16707 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | app/helpers/issues_helper.rb | 7 |
1 files 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 |