From d2fbc654eda972f88eeeacbabe1df34422df8045 Mon Sep 17 00:00:00 2001 From: Stanislav Koleda Date: Fri, 12 Jun 2020 12:27:41 +0700 Subject: [PATCH] Added group members to assigned --- lib/custom_users_as_assignees/issue_query_patch.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/custom_users_as_assignees/issue_query_patch.rb b/lib/custom_users_as_assignees/issue_query_patch.rb index ceff0d4..9b09a09 100644 --- a/lib/custom_users_as_assignees/issue_query_patch.rb +++ b/lib/custom_users_as_assignees/issue_query_patch.rb @@ -1,6 +1,6 @@ -module CustomUsersAsAssignees +module CustomUsersAsAssignees module IssueQueryPatch - def self.included(base) + def self.included(base) base.send :include, InstanceMethods base.class_eval do alias_method :initialize_available_filters_without_extra_filters, :initialize_available_filters @@ -12,11 +12,11 @@ module InstanceMethods def initialize_available_filters_with_extra_filters return @initialize_available_filters if @initialize_available_filters initialize_available_filters_without_extra_filters - + add_available_filter("just_assigned_to_id", :type => :list_optional, :values => lambda { assigned_to_values } ) - + @initialize_available_filters end @@ -28,6 +28,7 @@ def sql_for_just_assigned_to_id_field(field, operator, value) if value.delete("me") if User.current.logged? value.push(User.current.id.to_s) + value += User.current.group_ids.map(&:to_s) else value.push("0") end @@ -40,7 +41,7 @@ def sql_for_just_assigned_to_id_field(field, operator, value) def sql_for_assigned_to_id_field(field, operator, value) targets = value; value.each do |target| - begin + begin targets += User.find(target).group_ids.map(&:to_s) targets.uniq! rescue