Make Issues::BaseService match EE

We have `#allows_multiple_assignees?` defined in CE too, and `take(1)` appears
to be equivalent to `[0, 1]`.
This commit is contained in:
Sean McGivern 2018-07-05 12:34:42 +01:00
parent fe695ebd24
commit 3ac7203db9

View file

@ -32,8 +32,9 @@ module Issues
def filter_assignee(issuable) def filter_assignee(issuable)
return if params[:assignee_ids].blank? return if params[:assignee_ids].blank?
# The number of assignees is limited by one for GitLab CE unless issuable.allows_multiple_assignees?
params[:assignee_ids] = params[:assignee_ids][0, 1] params[:assignee_ids] = params[:assignee_ids].take(1)
end
assignee_ids = params[:assignee_ids].select { |assignee_id| assignee_can_read?(issuable, assignee_id) } assignee_ids = params[:assignee_ids].select { |assignee_id| assignee_can_read?(issuable, assignee_id) }