mirror of
https://github.com/meineerde/redmine.git
synced 2026-03-10 11:13:06 +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?
|
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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user