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:
parent
09147940fa
commit
0a72533b59
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue