Commit 87855e4a authored by Douwe Maan's avatar Douwe Maan

Merge branch '3488-fix-service-desk' into 'master'

Resolve "Service Desk filter Error 500"

Closes #3488

See merge request gitlab-org/gitlab-ee!2969
parents 871e051b 21a3d58e
---
title: Fix searching by assignee in the service desk
merge_request: 2969
author:
type: fixed
......@@ -27,6 +27,12 @@ Merging changes from GitLab CE to EE can result in numerous conflicts.
To reduce conflicts, EE code should be separated in to the `EE` module
as much as possible.
When referencing constants *outside* of the `EE` namespace from within it, you
should always use absolute constants - e.g., `::User` instead of `User`. This
will prevent `::EE::User` from being picked instead of `::User`. Follow this
rule even if the constant doesn't exist in the `EE` namespace at present - it
may be added in the future.
### Classes vs. Module Mixins
If the feature being developed is not present in any form in CE,
......
......@@ -12,7 +12,7 @@ module EE
def service_desk
if params[:assignee_id].present?
assignee = User.find_by_id(params[:assignee_id])
assignee = ::User.find_by_id(params[:assignee_id])
@users.push(assignee) if assignee
end
......
......@@ -227,6 +227,12 @@ describe Projects::IssuesController do
expect(assigns(:issues)).to contain_exactly(service_desk_issue_2)
end
it 'allows an assignee to be specified by id' do
get_service_desk(assignee_id: other_user.id)
expect(assigns(:users)).to contain_exactly(other_user, support_bot)
end
end
context 'when Service Desk is not available on the project' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment