]> source.dussan.org Git - redmine.git/commitdiff
Rails4: replace deprecated find_all_by_* at WorkflowsController#copy
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 10 Jan 2014 04:11:36 +0000 (04:11 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 10 Jan 2014 04:11:36 +0000 (04:11 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@12583 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/workflows_controller.rb

index 06ae30e2e9bd1d368d2c076b492b289b3a3488a6..24bd5c528c8a2f8904b8de0b9ba64da6fc6bbaf7 100644 (file)
@@ -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)