]> source.dussan.org Git - redmine.git/commitdiff
Preload associations used to display issues on My page.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 13 Mar 2017 20:06:33 +0000 (20:06 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 13 Mar 2017 20:06:33 +0000 (20:06 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@16395 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/my_helper.rb

index 042209cac2fb8623a4b1a504dc4b53a9acc2ef9f..3975d80b123041f4c24efc5549a2991b9ac67776 100644 (file)
@@ -93,13 +93,17 @@ module MyHelper
     Issue.visible.open.
       where(:author_id => User.current.id).
       limit(10).
-      includes(:status, :project, :tracker).
+      includes(:status, :project, :tracker, :priority).
       references(:status, :project, :tracker).
       order("#{Issue.table_name}.updated_on DESC")
   end
 
   def issueswatched_items
-    Issue.visible.open.on_active_project.watched_by(User.current.id).recently_updated.limit(10)
+    Issue.visible.open.
+      on_active_project.watched_by(User.current.id).
+      preload(:status, :project, :tracker, :priority).
+      recently_updated.
+      limit(10)
   end
 
   def news_items