diff options
-rw-r--r-- | app/controllers/workflows_controller.rb | 2 | ||||
-rw-r--r-- | app/models/workflow_rule.rb | 2 | ||||
-rw-r--r-- | app/models/workflow_transition.rb | 2 | ||||
-rw-r--r-- | app/views/workflows/edit.html.erb | 2 | ||||
-rw-r--r-- | app/views/workflows/permissions.html.erb | 2 |
5 files changed, 5 insertions, 5 deletions
diff --git a/app/controllers/workflows_controller.rb b/app/controllers/workflows_controller.rb index 28b0f2242..d00ee03bc 100644 --- a/app/controllers/workflows_controller.rb +++ b/app/controllers/workflows_controller.rb @@ -72,7 +72,7 @@ class WorkflowsController < ApplicationController end def copy - @roles = Role.sorted + @roles = Role.sorted.select(&:consider_workflow?) @trackers = Tracker.sorted if params[:source_tracker_id].blank? || params[:source_tracker_id] == 'any' diff --git a/app/models/workflow_rule.rb b/app/models/workflow_rule.rb index 0cd837d7c..bd53fac54 100644 --- a/app/models/workflow_rule.rb +++ b/app/models/workflow_rule.rb @@ -36,7 +36,7 @@ class WorkflowRule < ActiveRecord::Base target_roles = [target_roles].flatten.compact target_trackers = Tracker.sorted.to_a if target_trackers.empty? - target_roles = Role.all if target_roles.empty? + target_roles = Role.all.select(&:consider_workflow?) if target_roles.empty? target_trackers.each do |target_tracker| target_roles.each do |target_role| diff --git a/app/models/workflow_transition.rb b/app/models/workflow_transition.rb index e88769aa7..99c399644 100644 --- a/app/models/workflow_transition.rb +++ b/app/models/workflow_transition.rb @@ -21,7 +21,7 @@ class WorkflowTransition < WorkflowRule # Returns workflow transitions count by tracker and role def self.count_by_tracker_and_role counts = connection.select_all("SELECT role_id, tracker_id, count(id) AS c FROM #{table_name} WHERE type = 'WorkflowTransition' GROUP BY role_id, tracker_id") - roles = Role.sorted + roles = Role.sorted.to_a.select(&:consider_workflow?) trackers = Tracker.sorted result = [] trackers.each do |tracker| diff --git a/app/views/workflows/edit.html.erb b/app/views/workflows/edit.html.erb index e2a7f5810..ab9f72b9f 100644 --- a/app/views/workflows/edit.html.erb +++ b/app/views/workflows/edit.html.erb @@ -14,7 +14,7 @@ <%= form_tag({}, :method => 'get') do %> <p> <label><%=l(:label_role)%>: - <%= options_for_workflow_select 'role_id[]', Role.sorted, @roles, :id => 'role_id', :class => 'expandable' %> + <%= options_for_workflow_select 'role_id[]', Role.sorted.select(&:consider_workflow?), @roles, :id => 'role_id', :class => 'expandable' %> </label> <a href="#" data-expands="#role_id"><%= image_tag 'bullet_toggle_plus.png' %></a> diff --git a/app/views/workflows/permissions.html.erb b/app/views/workflows/permissions.html.erb index 2abd874a6..2c529864e 100644 --- a/app/views/workflows/permissions.html.erb +++ b/app/views/workflows/permissions.html.erb @@ -14,7 +14,7 @@ <%= form_tag({}, :method => 'get') do %> <p> <label><%=l(:label_role)%>: - <%= options_for_workflow_select 'role_id[]', Role.sorted, @roles, :id => 'role_id', :class => 'expandable' %> + <%= options_for_workflow_select 'role_id[]', Role.sorted.select(&:consider_workflow?), @roles, :id => 'role_id', :class => 'expandable' %> </label> <a href="#" data-expands="#role_id"><%= image_tag 'bullet_toggle_plus.png' %></a> |