From 599ac20570fb98932df7e55e1e8813fb2a8b46c2 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Wed, 8 Jan 2014 10:27:37 +0000 Subject: [PATCH] Rails4: replace deprecated Relation#update_all at Issue model git-svn-id: http://svn.redmine.org/redmine/trunk@12528 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/issue.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/issue.rb b/app/models/issue.rb index c09b591a1..a211ef25d 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -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