]> source.dussan.org Git - redmine.git/commitdiff
Use query with custom select for faster rendering of the project drop-down (#19102).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 14 Feb 2015 10:12:26 +0000 (10:12 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 14 Feb 2015 10:12:26 +0000 (10:12 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@14003 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/application_helper.rb

index 24d033a7eaf16928b47bcecb74532c4b86669472..74f8ab828a28537e32531c587dc8a764d7e9f2eb 100644 (file)
@@ -327,7 +327,7 @@ module ApplicationHelper
   # Renders the project quick-jump box
   def render_project_jump_box
     return unless User.current.logged?
-    projects = User.current.memberships.collect(&:project).compact.select(&:active?).uniq
+    projects = User.current.projects.active.select(:id, :name, :identifier, :lft, :rgt).to_a
     if projects.any?
       options =
         ("<option value=''>#{ l(:label_jump_to_a_project) }</option>" +