Project

General

Profile

Feature #4511 » 0001-Get-the-list-of-new-issue-watchers-using-single-quer.patch

Marius BĂLTEANU, 2020-04-25 09:31

View differences:

app/helpers/issues_helper.rb
364 364
  # on the new issue form
365 365
  def users_for_new_issue_watchers(issue)
366 366
    users = issue.watcher_users.select{|u| u.status == User::STATUS_ACTIVE}
367
    project = issue.project
368
    scope_users = project.users
369
    scope_groups = project.principals.merge(Group.givable)
370
    if scope_users.count + scope_groups.count <= 20
371
      users = (users + scope_users.sort + scope_groups.sort).uniq
367
    project_principals = issue.project.principals.where(:users => {:type => ['User', 'Group']}).limit(21)
368
    if project_principals.size <= 20
369
      users += project_principals.sort
372 370
    end
373
    users
371
    users.uniq
374 372
  end
375 373

  
376 374
  def email_issue_attributes(issue, user, html)
(10-10/10)