From ec09c2c3caffe3f9b1e54974db9713d8a96d7a56 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 24 Jan 2015 10:45:45 +0000 Subject: [PATCH] Memorize journal details value name to display. git-svn-id: http://svn.redmine.org/redmine/trunk@13938 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/issues_helper.rb | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index c16ce5022..a618a68e7 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -405,14 +405,18 @@ module IssuesHelper unless id.present? return nil end - association = Issue.reflect_on_association(field.to_sym) - if association - record = association.class_name.constantize.find_by_id(id) - if record - record.name.force_encoding('UTF-8') - return record.name + @detail_value_name_by_reflection ||= Hash.new do |hash, key| + association = Issue.reflect_on_association(key.first.to_sym) + if association + record = association.class_name.constantize.find_by_id(key.last) + if record + record.name.force_encoding('UTF-8') + hash[key] = record.name + end end + hash[key] ||= nil end + @detail_value_name_by_reflection[[field, id]] end # Renders issue children recursively -- 2.39.5