summaryrefslogtreecommitdiff
path: root/app/services/issues/base_service.rb
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2018-07-05 12:34:42 +0100
committerSean McGivern <sean@gitlab.com>2018-07-05 12:34:42 +0100
commit3ac7203db9f532f0de62c48f6bd9690b54d3b9d8 (patch)
treea4ff74e1f0d120a8ab77efd2e3685f0565402cb9 /app/services/issues/base_service.rb
parentfe695ebd24e59f82d16aba629dd6d117be3ee5bb (diff)
downloadgitlab-ce-3ac7203db9f532f0de62c48f6bd9690b54d3b9d8.tar.gz
Make Issues::BaseService match EE
We have `#allows_multiple_assignees?` defined in CE too, and `take(1)` appears to be equivalent to `[0, 1]`.
Diffstat (limited to 'app/services/issues/base_service.rb')
-rw-r--r--app/services/issues/base_service.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/services/issues/base_service.rb b/app/services/issues/base_service.rb
index 9f6cfc0f6d3..cbfef175af0 100644
--- a/app/services/issues/base_service.rb
+++ b/app/services/issues/base_service.rb
@@ -32,8 +32,9 @@ module Issues
def filter_assignee(issuable)
return if params[:assignee_ids].blank?
- # The number of assignees is limited by one for GitLab CE
- params[:assignee_ids] = params[:assignee_ids][0, 1]
+ unless issuable.allows_multiple_assignees?
+ params[:assignee_ids] = params[:assignee_ids].take(1)
+ end
assignee_ids = params[:assignee_ids].select { |assignee_id| assignee_can_read?(issuable, assignee_id) }