summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2023-04-13 23:34:23 +0000
committerGo MAEDA <maeda@farend.jp>2023-04-13 23:34:23 +0000
commit798cd2d566a7b8c17b576068c805b8947aca09af (patch)
treecc728a197831dc045bb2b62026ff94475f83aaea /app
parenta48700d58b3d6ad466e56b8b64d5563c36134f33 (diff)
downloadredmine-798cd2d566a7b8c17b576068c805b8947aca09af.tar.gz
redmine-798cd2d566a7b8c17b576068c805b8947aca09af.zip
Roles of a project member should not be made empty (#37166).
Patch by Mizuki ISHIKAWA. git-svn-id: https://svn.redmine.org/redmine/trunk@22182 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/models/member_role.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/member_role.rb b/app/models/member_role.rb
index 94c6615a2..a20531f94 100644
--- a/app/models/member_role.rb
+++ b/app/models/member_role.rb
@@ -52,7 +52,7 @@ class MemberRole < ActiveRecord::Base
private
def remove_member_if_empty
- if @member_removal != false && member.roles.empty?
+ if @member_removal != false && member.roles.reload.empty?
member.destroy
end
end