summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2011-03-28 20:32:35 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2011-03-28 20:32:35 +0000
commitba0c9069ed64db6b4fea7f3f1759dbe064c867f7 (patch)
tree56e4f4d376723457eb8f4c2c3380dc004a0d379b /app
parent1c03b418e193638205a17b95e056844b74f22b0e (diff)
downloadredmine-ba0c9069ed64db6b4fea7f3f1759dbe064c867f7.tar.gz
redmine-ba0c9069ed64db6b4fea7f3f1759dbe064c867f7.zip
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
Diffstat (limited to 'app')
-rw-r--r--app/helpers/issues_helper.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb
index f9f1c41ac..e4d35c217 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 << '<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