summaryrefslogtreecommitdiffstats
path: root/app/models/member.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2014-07-29 17:49:53 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2014-07-29 17:49:53 +0000
commit41e7210210b5e50bf57bbcf41259a4d343bba1f0 (patch)
tree884f572467d67a31084357a290b52c4e7d35d81e /app/models/member.rb
parentd2b505b2c33217971ca965b0af9ab6f78e5c11ba (diff)
downloadredmine-41e7210210b5e50bf57bbcf41259a4d343bba1f0.tar.gz
redmine-41e7210210b5e50bf57bbcf41259a4d343bba1f0.zip
Fixed an error when member's project is nil (#17486).
git-svn-id: http://svn.redmine.org/redmine/trunk@13334 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/member.rb')
-rw-r--r--app/models/member.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/member.rb b/app/models/member.rb
index 547fa9eaa..aa1d50cdf 100644
--- a/app/models/member.rb
+++ b/app/models/member.rb
@@ -94,9 +94,9 @@ class Member < ActiveRecord::Base
end
def set_issue_category_nil
- if user
+ if user_id && project_id
# remove category based auto assignments for this member
- IssueCategory.where(["project_id = ? AND assigned_to_id = ?", project.id, user.id]).
+ IssueCategory.where(["project_id = ? AND assigned_to_id = ?", project_id, user_id]).
update_all("assigned_to_id = NULL")
end
end