]> source.dussan.org Git - redmine.git/commitdiff
avoid multi-line ternary operators in app/controllers/workflows_controller.rb
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sat, 4 Jul 2020 12:14:11 +0000 (12:14 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sat, 4 Jul 2020 12:14:11 +0000 (12:14 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@19854 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/workflows_controller.rb

index 333a38b661471187912844f83af6577345545e4e..d53d007f849f972d098c71de250dafc4a4a0d65e 100644 (file)
@@ -92,10 +92,18 @@ 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.where(:id => params[:target_tracker_ids]).to_a
-    @target_roles = params[:target_role_ids].blank? ?
-        nil : Role.where(:id => params[:target_role_ids]).to_a
+    @target_trackers =
+      if params[:target_tracker_ids].blank?
+        nil
+      else
+        Tracker.where(:id => params[:target_tracker_ids]).to_a
+      end
+    @target_roles =
+      if params[:target_role_ids].blank?
+        nil
+      else
+        Role.where(:id => params[:target_role_ids]).to_a
+      end
     if request.post?
       if params[:source_tracker_id].blank? || params[:source_role_id].blank? ||
            (@source_tracker.nil? && @source_role.nil?)