]> source.dussan.org Git - redmine.git/commitdiff
Rails4: replace deprecated Relation#update_all at IssuesController
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 10 Jan 2014 03:39:51 +0000 (03:39 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 10 Jan 2014 03:39:51 +0000 (03:39 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@12580 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/issues_controller.rb

index 7818cada0b3b4dec808407317590f6bcbd8d20f9..f89298c4ce06c5722ee49a41cb2bf0e2af5ba0ed 100644 (file)
@@ -310,14 +310,15 @@ class IssuesController < ApplicationController
       when 'destroy'
         # nothing to do
       when 'nullify'
-        TimeEntry.update_all('issue_id = NULL', ['issue_id IN (?)', @issues])
+        TimeEntry.where(['issue_id IN (?)', @issues]).update_all('issue_id = NULL')
       when 'reassign'
         reassign_to = @project.issues.find_by_id(params[:reassign_to_id])
         if reassign_to.nil?
           flash.now[:error] = l(:error_issue_not_found_in_project)
           return
         else
-          TimeEntry.update_all("issue_id = #{reassign_to.id}", ['issue_id IN (?)', @issues])
+          TimeEntry.where(['issue_id IN (?)', @issues]).
+            update_all("issue_id = #{reassign_to.id}")
         end
       else
         # display the destroy form if it's a user request