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

app/models/issue_category.rb

index 6efec6a5def34020a1dc383a3678af92d637de08..10464e8e06febf42b2494c02821d7a177c3c0d94 100644 (file)
@@ -35,7 +35,7 @@ class IssueCategory < ActiveRecord::Base
   # If a category is specified, issues are reassigned to this category
   def destroy(reassign_to = nil)
     if reassign_to && reassign_to.is_a?(IssueCategory) && reassign_to.project == self.project
-      Issue.update_all({:category_id => reassign_to.id}, {:category_id => id})
+      Issue.where({:category_id => id}).update_all({:category_id => reassign_to.id})
     end
     destroy_without_reassign
   end