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:
parent
a8ccddc289
commit
64be81a433
|
@ -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>" +
|
||||
|
|
Loading…
Reference in New Issue