Added an optimization note for later.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3207 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Eric Davis 2009-12-20 19:13:27 +00:00
parent 1ebb78e412
commit 6be0e335fb
1 changed files with 1 additions and 0 deletions

View File

@ -186,6 +186,7 @@ class Query < ActiveRecord::Base
user_values += project.users.sort.collect{|s| [s.name, s.id.to_s] } user_values += project.users.sort.collect{|s| [s.name, s.id.to_s] }
else else
# members of the user's projects # members of the user's projects
# OPTIMIZE: Is selecting from users per project (N+1)
user_values += User.current.projects.collect(&:users).flatten.uniq.sort.collect{|s| [s.name, s.id.to_s] } user_values += User.current.projects.collect(&:users).flatten.uniq.sort.collect{|s| [s.name, s.id.to_s] }
end end
@available_filters["assigned_to_id"] = { :type => :list_optional, :order => 4, :values => user_values } unless user_values.empty? @available_filters["assigned_to_id"] = { :type => :list_optional, :order => 4, :values => user_values } unless user_values.empty?