]> source.dussan.org Git - redmine.git/commitdiff
Merged r22833 to 5.1-stable (#40693).
authorGo MAEDA <maeda@farend.jp>
Sat, 18 May 2024 04:58:15 +0000 (04:58 +0000)
committerGo MAEDA <maeda@farend.jp>
Sat, 18 May 2024 04:58:15 +0000 (04:58 +0000)
git-svn-id: https://svn.redmine.org/redmine/branches/5.1-stable@22836 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/project.rb
test/functional/reports_controller_test.rb
test/unit/project_test.rb

index 9f9656976347ecf6ff139899f8fa8aeaef932dec..08fdefabdf88bd9726c5ddbf1b214a810e51c7f1 100644 (file)
@@ -492,6 +492,7 @@ class Project < ActiveRecord::Base
   def rolled_up_statuses
     issue_status_ids = WorkflowTransition.
       where(:tracker_id => rolled_up_trackers.map(&:id)).
+      where('old_status_id <> new_status_id').
       distinct.
       pluck(:old_status_id, :new_status_id).
       flatten.
index 67ea188f2e79e1d69d7730e171410827205bf585..9f6624f6a8c9e9ef60e84a454e388574678426bc 100644 (file)
@@ -107,6 +107,8 @@ class ReportsControllerTest < Redmine::ControllerTest
     WorkflowTransition.create(:role_id => 1, :tracker_id => 1, :old_status_id => 1, :new_status_id => 4)
     WorkflowTransition.create(:role_id => 1, :tracker_id => 1, :old_status_id => 2, :new_status_id => 5)
     WorkflowTransition.create(:role_id => 1, :tracker_id => 2, :old_status_id => 1, :new_status_id => 6)
+    WorkflowTransition.create(:role_id => 1, :tracker_id => 2, :old_status_id => 3, :new_status_id => 3)
+
     with_settings :display_subprojects_issues => '0' do
       get(:issue_report_details, :params => {:id => 1, :detail => 'tracker'})
     end
index eacbf0c92e9b3a098d481e91700e8b4d53df097f..291ce2ff35c1a2d6ad28ca1483d4835138a70bc9 100644 (file)
@@ -534,6 +534,8 @@ class ProjectTest < ActiveSupport::TestCase
     WorkflowTransition.create(:role_id => 1, :tracker_id => 1, :old_status_id => 1, :new_status_id => 4)
     WorkflowTransition.create(:role_id => 1, :tracker_id => 1, :old_status_id => 2, :new_status_id => 3)
     WorkflowTransition.create(:role_id => 1, :tracker_id => 2, :old_status_id => 1, :new_status_id => 3)
+    WorkflowTransition.create(:role_id => 1, :tracker_id => 1, :old_status_id => 5, :new_status_id => 5)
+    WorkflowTransition.create(:role_id => 1, :tracker_id => 2, :old_status_id => 5, :new_status_id => 5)
 
     assert_kind_of IssueStatus, project.rolled_up_statuses.first
     assert_equal IssueStatus.find(1), project.rolled_up_statuses.first