Rails4: replace deprecated Relation#update_all at IssuesController

git-svn-id: http://svn.redmine.org/redmine/trunk@12580 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2014-01-10 03:39:51 +00:00
parent 09147940fa
commit 0a72533b59
1 changed files with 3 additions and 2 deletions

View 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