@@ -324,7 +324,10 class Mailer < ActionMailer::Base | |||
|
324 | 324 | days = options[:days] || 7 |
|
325 | 325 | project = options[:project] ? Project.find(options[:project]) : nil |
|
326 | 326 | tracker = options[:tracker] ? Tracker.find(options[:tracker]) : nil |
|
327 |
target_version |
|
|
327 | target_version_id = options[:version] ? Version.named(options[:version]).pluck(:id) : nil | |
|
328 | if options[:version] && target_version_id.blank? | |
|
329 | raise ActiveRecord::RecordNotFound.new("Couldn't find Version with named #{options[:version]}") | |
|
330 | end | |
|
328 | 331 | user_ids = options[:users] |
|
329 | 332 | |
|
330 | 333 | scope = Issue.open.where("#{Issue.table_name}.assigned_to_id IS NOT NULL" + |
@@ -333,7 +336,7 class Mailer < ActionMailer::Base | |||
|
333 | 336 | ) |
|
334 | 337 | scope = scope.where(:assigned_to_id => user_ids) if user_ids.present? |
|
335 | 338 | scope = scope.where(:project_id => project.id) if project |
|
336 |
scope = scope.where(:fixed_version_id => target_version |
|
|
339 | scope = scope.where(:fixed_version_id => target_version_id) if target_version_id.present? | |
|
337 | 340 | scope = scope.where(:tracker_id => tracker.id) if tracker |
|
338 | 341 | issues_by_assignee = scope.includes(:status, :assigned_to, :project, :tracker). |
|
339 | 342 | group_by(&:assigned_to) |
General Comments 0
You need to be logged in to leave comments.
Login now