From ba0c9069ed64db6b4fea7f3f1759dbe064c867f7 2011-03-28 20:32:35 From: Jean-Philippe Lang Date: 2011-03-28 20:32:35 Subject: [PATCH] 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 --- diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index f9f1c41..e4d35c2 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -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 << '
' + content_tag('p', link_to_issue(ancestor)) end s << '
' + content_tag('h3', h(issue.subject)) - s << '
' * (issue.ancestors.size + 1) + s << '
' * (ancestors.size + 1) s end