1
0
mirror of https://github.com/meineerde/redmine.git synced 2026-03-10 03:03:05 +00:00

Memorize journal details value name to display.

git-svn-id: http://svn.redmine.org/redmine/trunk@13938 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2015-01-24 10:45:45 +00:00
parent e3ffb1f23b
commit ec09c2c3ca

View File

@ -405,14 +405,18 @@ module IssuesHelper
unless id.present? unless id.present?
return nil return nil
end end
association = Issue.reflect_on_association(field.to_sym) @detail_value_name_by_reflection ||= Hash.new do |hash, key|
if association association = Issue.reflect_on_association(key.first.to_sym)
record = association.class_name.constantize.find_by_id(id) if association
if record record = association.class_name.constantize.find_by_id(key.last)
record.name.force_encoding('UTF-8') if record
return record.name record.name.force_encoding('UTF-8')
hash[key] = record.name
end
end end
hash[key] ||= nil
end end
@detail_value_name_by_reflection[[field, id]]
end end
# Renders issue children recursively # Renders issue children recursively