Rails4: replace deprecated Relation#update_all at Issue model

git-svn-id: http://svn.redmine.org/redmine/trunk@12528 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2014-01-08 10:27:37 +00:00
parent e80d9bb69a
commit 599ac20570
1 changed files with 2 additions and 1 deletions

View File

@ -1286,7 +1286,8 @@ class Issue < ActiveRecord::Base
# issue was just created
self.root_id = (@parent_issue.nil? ? id : @parent_issue.root_id)
set_default_left_and_right
Issue.update_all(["root_id = ?, lft = ?, rgt = ?", root_id, lft, rgt], ["id = ?", id])
Issue.where(["id = ?", id]).
update_all(["root_id = ?, lft = ?, rgt = ?", root_id, lft, rgt])
if @parent_issue
move_to_child_of(@parent_issue)
end