Saves an extra SQL query on each request.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5153 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2011-03-16 19:26:07 +00:00
parent a8ccddc289
commit 64be81a433
1 changed files with 1 additions and 2 deletions

View File

@ -223,8 +223,7 @@ module ApplicationHelper
# Renders the project quick-jump box
def render_project_jump_box
# Retrieve them now to avoid a COUNT query
projects = User.current.projects.all
projects = User.current.memberships.collect(&:project).compact.uniq
if projects.any?
s = '<select onchange="if (this.value != \'\') { window.location = this.value; }">' +
"<option value=''>#{ l(:label_jump_to_a_project) }</option>" +