Project

General

Profile

Defect #25867 » issue.rb.patch

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

View differences:

issue.rb (working copy)
def reload(*args)
@workflow_rule_by_attribute = nil
@assignable_versions = nil
@assignable_users = nil
@relations = nil
@spent_hours = nil
@total_spent_hours = nil
......
# Users the issue can be assigned to
def assignable_users
users = project.assignable_users(tracker).to_a
users << author if author && author.active?
if assigned_to_id_was.present? && assignee = Principal.find_by_id(assigned_to_id_was)
users << assignee
return @assignable_users unless @assignable_users.nil?
user_ids = []
user_ids << author_id if author && author.active?
user_ids << assigned_to_id_was if assigned_to_id_was.present?
if project
project_users = project.assignable_users(tracker)
user_ids.concat project_users.reorder(nil).pluck(:id)
end
users.uniq.sort
@assignable_users = user_ids.empty? ? [] : Principal.where(:id => user_ids).sorted.to_a
end
# Versions that the issue can be assigned to
(2-2/3)