From ba8a8dede3c88b8d8aaf86e7ddc316f8dc5cb3f1 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Thu, 22 Oct 2020 14:17:58 +0000 Subject: [PATCH] shorten long line of lib/redmine/default_data/loader.rb git-svn-id: http://svn.redmine.org/redmine/trunk@20161 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/redmine/default_data/loader.rb | 61 +++++++++++++++++++----------- 1 file changed, 39 insertions(+), 22 deletions(-) diff --git a/lib/redmine/default_data/loader.rb b/lib/redmine/default_data/loader.rb index 272351fc6..f74b04b86 100644 --- a/lib/redmine/default_data/loader.rb +++ b/lib/redmine/default_data/loader.rb @@ -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 -- 2.39.5