diff options
Diffstat (limited to 'app/models/issue_query.rb')
-rw-r--r-- | app/models/issue_query.rb | 4 |
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} " + |