mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-24 01:11:12 +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:
parent
e3ffb1f23b
commit
ec09c2c3ca
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user