Project

General

Profile

Defect #25867 » issue.rb.patch

Pavel Rosický, 2017-05-18 21:57

View differences:

issue.rb (working copy)
241 241
  def reload(*args)
242 242
    @workflow_rule_by_attribute = nil
243 243
    @assignable_versions = nil
244
    @assignable_users = nil
244 245
    @relations = nil
245 246
    @spent_hours = nil
246 247
    @total_spent_hours = nil
......
911 912

  
912 913
  # Users the issue can be assigned to
913 914
  def assignable_users
914
    users = project.assignable_users(tracker).to_a
915
    users << author if author && author.active?
916
    if assigned_to_id_was.present? && assignee = Principal.find_by_id(assigned_to_id_was)
917
      users << assignee
915
    return @assignable_users unless @assignable_users.nil?
916
    user_ids = []
917
    user_ids << author_id if author && author.active?
918
    user_ids << assigned_to_id_was if assigned_to_id_was.present?
919
    if project
920
      project_users = project.assignable_users(tracker)
921
      user_ids.concat project_users.reorder(nil).pluck(:id)
918 922
    end
919
    users.uniq.sort
923
    @assignable_users = user_ids.empty? ? [] : Principal.where(:id => user_ids).sorted.to_a
920 924
  end
921 925

  
922 926
  # Versions that the issue can be assigned to
(2-2/3)