From 2ce3191639dcbf3929ce2208a5edba96ba812a2c Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 23 Jul 2011 19:24:02 +0000 Subject: [PATCH] Assignee is removed on issue update if assignee account is locked (#8884). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@6308 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/issue.rb | 1 + test/unit/issue_test.rb | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/app/models/issue.rb b/app/models/issue.rb index d7a3e6ecb..b4aac4a36 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -451,6 +451,7 @@ class Issue < ActiveRecord::Base def assignable_users users = project.assignable_users users << author if author + users << assigned_to if assigned_to users.uniq.sort end diff --git a/test/unit/issue_test.rb b/test/unit/issue_test.rb index f36bf9049..5b6667b79 100644 --- a/test/unit/issue_test.rb +++ b/test/unit/issue_test.rb @@ -693,6 +693,15 @@ class IssueTest < ActiveSupport::TestCase assert issue.assignable_users.include?(non_project_member) end + should "include the current assignee" do + project = Project.find(1) + user = User.generate! + issue = Issue.generate_for_project!(project, :assigned_to => user) + user.lock! + + assert Issue.find(issue.id).assignable_users.include?(user) + end + should "not show the issue author twice" do assignable_user_ids = Issue.find(1).assignable_users.collect(&:id) assert_equal 2, assignable_user_ids.length -- 2.39.5