From: Toshi MARUYAMA Date: Fri, 10 Jan 2014 04:11:36 +0000 (+0000) Subject: Rails4: replace deprecated find_all_by_* at WorkflowsController#copy X-Git-Tag: 2.5.0~316 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ee49bdd81bc8e5606c9518d006aed03bc39eab76;p=redmine.git Rails4: replace deprecated find_all_by_* at WorkflowsController#copy git-svn-id: http://svn.redmine.org/redmine/trunk@12583 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/controllers/workflows_controller.rb b/app/controllers/workflows_controller.rb index 06ae30e2e..24bd5c528 100644 --- a/app/controllers/workflows_controller.rb +++ b/app/controllers/workflows_controller.rb @@ -88,7 +88,6 @@ class WorkflowsController < ApplicationController end def copy - if params[:source_tracker_id].blank? || params[:source_tracker_id] == 'any' @source_tracker = nil else @@ -99,10 +98,10 @@ class WorkflowsController < ApplicationController else @source_role = Role.find_by_id(params[:source_role_id].to_i) end - - @target_trackers = params[:target_tracker_ids].blank? ? nil : Tracker.find_all_by_id(params[:target_tracker_ids]) - @target_roles = params[:target_role_ids].blank? ? nil : Role.find_all_by_id(params[:target_role_ids]) - + @target_trackers = params[:target_tracker_ids].blank? ? + nil : Tracker.where(:id => params[:target_tracker_ids]).all + @target_roles = params[:target_role_ids].blank? ? + nil : Role.where(:id => params[:target_role_ids]) if request.post? if params[:source_tracker_id].blank? || params[:source_role_id].blank? || (@source_tracker.nil? && @source_role.nil?) flash.now[:error] = l(:error_workflow_copy_source)