From ab2b130e3c3de6b861264a01ccdb6c90a3d7e5d6 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Sat, 17 Sep 2022 07:58:12 +0000 Subject: Ignore statuses if workflow only defines identity transition (#37636). Patch by Holger Just. git-svn-id: https://svn.redmine.org/redmine/trunk@21818 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/workflows_controller.rb | 2 ++ app/models/tracker.rb | 1 + 2 files changed, 3 insertions(+) (limited to 'app') diff --git a/app/controllers/workflows_controller.rb b/app/controllers/workflows_controller.rb index c0d5f865e..3157ec6b3 100644 --- a/app/controllers/workflows_controller.rb +++ b/app/controllers/workflows_controller.rb @@ -161,6 +161,8 @@ class WorkflowsController < ApplicationController role_ids = Role.all.select(&:consider_workflow?).map(&:id) status_ids = WorkflowTransition.where( :tracker_id => @trackers.map(&:id), :role_id => role_ids + ).where( + 'old_status_id <> new_status_id' ).distinct.pluck(:old_status_id, :new_status_id).flatten.uniq @statuses = IssueStatus.where(:id => status_ids).sorted.to_a.presence end diff --git a/app/models/tracker.rb b/app/models/tracker.rb index c5665054c..fcc61222f 100644 --- a/app/models/tracker.rb +++ b/app/models/tracker.rb @@ -108,6 +108,7 @@ class Tracker < ActiveRecord::Base else @issue_status_ids ||= WorkflowTransition.where(:tracker_id => id). + where('old_status_id <> new_status_id'). distinct.pluck(:old_status_id, :new_status_id).flatten.uniq end end -- cgit v1.2.3