Rails4: replace deprecated Relation#update_all at Member model

git-svn-id: http://svn.redmine.org/redmine/trunk@12512 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2014-01-08 04:58:13 +00:00
parent 5b77bd0076
commit 30e3e7e0b4
1 changed files with 2 additions and 1 deletions

View File

@ -84,7 +84,8 @@ class Member < ActiveRecord::Base
def set_issue_category_nil
if user
# remove category based auto assignments for this member
IssueCategory.update_all "assigned_to_id = NULL", ["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