summaryrefslogtreecommitdiffstats
path: root/app/models/issue_query.rb
diff options
context:
space:
mode:
authorMarius Balteanu <marius.balteanu@zitec.com>2024-05-12 07:42:23 +0000
committerMarius Balteanu <marius.balteanu@zitec.com>2024-05-12 07:42:23 +0000
commit4ec21ecdf5feda099796235bdc45917871ddada7 (patch)
tree0881ba3c2afdc469c59f6aa0ee10b2325ca97b20 /app/models/issue_query.rb
parent0d5e9d21ffe4a3dd0825b62fbd9b477d4ec1ca55 (diff)
downloadredmine-4ec21ecdf5feda099796235bdc45917871ddada7.tar.gz
redmine-4ec21ecdf5feda099796235bdc45917871ddada7.zip
Merged r22819 and r22820 to 5.1-stable (#40412).
git-svn-id: https://svn.redmine.org/redmine/branches/5.1-stable@22824 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/issue_query.rb')
-rw-r--r--app/models/issue_query.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/issue_query.rb b/app/models/issue_query.rb
index bede78575..d368dbe17 100644
--- a/app/models/issue_query.rb
+++ b/app/models/issue_query.rb
@@ -521,7 +521,9 @@ class IssueQuery < Query
def sql_for_watcher_id_field(field, operator, value)
db_table = Watcher.table_name
- me, others = value.partition {|id| ['0', User.current.id.to_s].include?(id)}
+ me_ids = [0, User.current.id]
+ me_ids = me_ids.concat(User.current.groups.pluck(:id))
+ me, others = value.partition {|id| me_ids.include?(id.to_i)}
sql =
if others.any?
"SELECT #{Issue.table_name}.id FROM #{Issue.table_name} " +