]> source.dussan.org Git - redmine.git/commitdiff
Rails4: replace deprecated Relation#update_all at Issue model
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Wed, 8 Jan 2014 10:27:37 +0000 (10:27 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Wed, 8 Jan 2014 10:27:37 +0000 (10:27 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@12528 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/issue.rb

index c09b591a1042c2a4a7ad6cb79fa20dd27ca7642c..a211ef25db0351af30ef79a9714494cb4318800c 100644 (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