# Users issues can be assigned to
def assignable_users
- members.select {|m| m.role.assignable?}.collect {|m| m.user}
+ members.select {|m| m.role.assignable?}.collect {|m| m.user}.sort
end
# Returns the mail adresses of users that should be always notified on project events
user_values = []
user_values << ["<< #{l(:label_me)} >>", "me"] if executed_by
if project
- user_values += project.users.collect{|s| [s.name, s.id.to_s] }
+ user_values += project.users.sort.collect{|s| [s.name, s.id.to_s] }
elsif executed_by
# members of the user's projects
user_values += executed_by.projects.collect(&:users).flatten.uniq.sort.collect{|s| [s.name, s.id.to_s] }
end
def <=>(user)
- lastname == user.lastname ? firstname <=> user.firstname : lastname <=> user.lastname
+ user.nil? ? -1 : (lastname == user.lastname ? firstname <=> user.firstname : lastname <=> user.lastname)
end
def to_s