Save 2 queries when displaying a root issue.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5244 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
d022da5dd5
commit
2e2f79aa27
|
@ -57,11 +57,12 @@ module IssuesHelper
|
|||
|
||||
def render_issue_subject_with_tree(issue)
|
||||
s = ''
|
||||
issue.ancestors.each do |ancestor|
|
||||
ancestors = issue.root? ? [] : issue.ancestors.all
|
||||
ancestors.each do |ancestor|
|
||||
s << '<div>' + content_tag('p', link_to_issue(ancestor))
|
||||
end
|
||||
s << '<div>' + content_tag('h3', h(issue.subject))
|
||||
s << '</div>' * (issue.ancestors.size + 1)
|
||||
s << '</div>' * (ancestors.size + 1)
|
||||
s
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue