]> source.dussan.org Git - redmine.git/commitdiff
shorten long line of lib/redmine/default_data/loader.rb
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Thu, 22 Oct 2020 14:17:58 +0000 (14:17 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Thu, 22 Oct 2020 14:17:58 +0000 (14:17 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@20161 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/default_data/loader.rb

index 272351fc6534c683f474ddfba2860ddf75304dc4..f74b04b865e1b919d5023c8050b7ed4380e00e7f 100644 (file)
@@ -154,30 +154,47 @@ module Redmine
 
             if workflow
               # Workflow
-              Tracker.all.each { |t|
-                IssueStatus.all.each { |os|
-                  IssueStatus.all.each { |ns|
-                    WorkflowTransition.create!(:tracker_id => t.id, :role_id => manager.id, :old_status_id => os.id, :new_status_id => ns.id) unless os == ns
-                  }
-                }
-              }
+              Tracker.all.each do |t|
+                IssueStatus.all.each do |os|
+                  IssueStatus.all.each do |ns|
+                    unless os == ns
+                      WorkflowTransition.
+                        create!(:tracker_id => t.id, :role_id => manager.id,
+                                :old_status_id => os.id,
+                                :new_status_id => ns.id)
+                    end
+                  end
+                end
+              end
 
-              Tracker.all.each { |t|
-                [new, in_progress, resolved, feedback].each { |os|
-                  [in_progress, resolved, feedback, closed].each { |ns|
-                    WorkflowTransition.create!(:tracker_id => t.id, :role_id => developer.id, :old_status_id => os.id, :new_status_id => ns.id) unless os == ns
-                  }
-                }
-              }
+              Tracker.all.each do |t|
+                [new, in_progress, resolved, feedback].each do |os|
+                  [in_progress, resolved, feedback, closed].each do |ns|
+                    unless os == ns
+                      WorkflowTransition.
+                        create!(:tracker_id => t.id, :role_id => developer.id,
+                                :old_status_id => os.id,
+                                :new_status_id => ns.id)
+                    end
+                  end
+                end
+              end
 
-              Tracker.all.each { |t|
-                [new, in_progress, resolved, feedback].each { |os|
-                  [closed].each { |ns|
-                    WorkflowTransition.create!(:tracker_id => t.id, :role_id => reporter.id, :old_status_id => os.id, :new_status_id => ns.id) unless os == ns
-                  }
-                }
-                WorkflowTransition.create!(:tracker_id => t.id, :role_id => reporter.id, :old_status_id => resolved.id, :new_status_id => feedback.id)
-              }
+              Tracker.all.each do |t|
+                [new, in_progress, resolved, feedback].each do |os|
+                  [closed].each do |ns|
+                    unless os == ns
+                      WorkflowTransition.
+                        create!(:tracker_id => t.id, :role_id => reporter.id,
+                                :old_status_id => os.id, :new_status_id => ns.id)
+                    end
+                  end
+                end
+                WorkflowTransition.
+                  create!(:tracker_id => t.id, :role_id => reporter.id,
+                          :old_status_id => resolved.id,
+                          :new_status_id => feedback.id)
+              end
             end
 
             # Enumerations