Code cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10337 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
62d5b4c710
commit
972a991a92
|
@ -334,15 +334,15 @@ class Mailer < ActionMailer::Base
|
|||
tracker = options[:tracker] ? Tracker.find(options[:tracker]) : nil
|
||||
user_ids = options[:users]
|
||||
|
||||
scope = Issue.open.scoped(:conditions => ["#{Issue.table_name}.assigned_to_id IS NOT NULL" +
|
||||
scope = Issue.open.where("#{Issue.table_name}.assigned_to_id IS NOT NULL" +
|
||||
" AND #{Project.table_name}.status = #{Project::STATUS_ACTIVE}" +
|
||||
" AND #{Issue.table_name}.due_date <= ?", days.day.from_now.to_date]
|
||||
" AND #{Issue.table_name}.due_date <= ?", days.day.from_now.to_date
|
||||
)
|
||||
scope = scope.scoped(:conditions => {:assigned_to_id => user_ids}) if user_ids.present?
|
||||
scope = scope.scoped(:conditions => {:project_id => project.id}) if project
|
||||
scope = scope.scoped(:conditions => {:tracker_id => tracker.id}) if tracker
|
||||
scope = scope.where(:assigned_to_id => user_ids) if user_ids.present?
|
||||
scope = scope.where(:project_id => project.id) if project
|
||||
scope = scope.where(:tracker_id => tracker.id) if tracker
|
||||
|
||||
issues_by_assignee = scope.all(:include => [:status, :assigned_to, :project, :tracker]).group_by(&:assigned_to)
|
||||
issues_by_assignee = scope.includes(:status, :assigned_to, :project, :tracker).all.group_by(&:assigned_to)
|
||||
issues_by_assignee.keys.each do |assignee|
|
||||
if assignee.is_a?(Group)
|
||||
assignee.users.each do |user|
|
||||
|
|
Loading…
Reference in New Issue