diff options
author | Oswaldo Ferreira <oswaldo@gitlab.com> | 2019-04-07 15:35:16 -0300 |
---|---|---|
committer | Oswaldo Ferreira <oswaldo@gitlab.com> | 2019-04-08 18:40:00 -0300 |
commit | ca884980ee8e6fe1269f5abdb803519d51aa09c0 (patch) | |
tree | 517a448ce25452f26acb5e62384778a99da2f699 /app/services/system_note_service.rb | |
parent | 225edb0d2d7737cf52ef5cd358082d08e20feaa4 (diff) | |
download | gitlab-ce-ca884980ee8e6fe1269f5abdb803519d51aa09c0.tar.gz |
[CE] Support multiple assignees for merge requestsosw-multi-assignees-merge-requests
Backports https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/10161
(code out of ee/ folder).
Diffstat (limited to 'app/services/system_note_service.rb')
-rw-r--r-- | app/services/system_note_service.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/services/system_note_service.rb b/app/services/system_note_service.rb index acbbb0da929..a39ff76b798 100644 --- a/app/services/system_note_service.rb +++ b/app/services/system_note_service.rb @@ -69,7 +69,7 @@ module SystemNoteService # Called when the assignees of an Issue is changed or removed # - # issue - Issue object + # issuable - Issuable object (responds to assignees) # project - Project owning noteable # author - User performing the change # assignees - Users being assigned, or nil @@ -85,9 +85,9 @@ module SystemNoteService # "assigned to @user1 and @user2" # # Returns the created Note object - def change_issue_assignees(issue, project, author, old_assignees) - unassigned_users = old_assignees - issue.assignees - added_users = issue.assignees.to_a - old_assignees + def change_issuable_assignees(issuable, project, author, old_assignees) + unassigned_users = old_assignees - issuable.assignees + added_users = issuable.assignees.to_a - old_assignees text_parts = [] text_parts << "assigned to #{added_users.map(&:to_reference).to_sentence}" if added_users.any? @@ -95,7 +95,7 @@ module SystemNoteService body = text_parts.join(' and ') - create_note(NoteSummary.new(issue, project, author, body, action: 'assignee')) + create_note(NoteSummary.new(issuable, project, author, body, action: 'assignee')) end # Called when the milestone of a Noteable is changed |