Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarka Kadlecova <jarka@gitlab.com>2017-09-01 15:03:57 +0300
committerJarka Kadlecova <jarka@gitlab.com>2017-09-14 15:50:32 +0300
commit994e7d135947ca162c147c5e0992a0190de22808 (patch)
treecd9ea4d93269c8597541f8c59e89a83ca2b56d2b /app/services/system_note_service.rb
parent2b82f907abf2074ac332531d6142893d081f44b9 (diff)
Create system notes for MR too, improve doc + clean up code
Diffstat (limited to 'app/services/system_note_service.rb')
-rw-r--r--app/services/system_note_service.rb9
1 files changed, 2 insertions, 7 deletions
diff --git a/app/services/system_note_service.rb b/app/services/system_note_service.rb
index cec0a1b6efa..7b32e215c7f 100644
--- a/app/services/system_note_service.rb
+++ b/app/services/system_note_service.rb
@@ -592,13 +592,8 @@ module SystemNoteService
end
def discussion_lock(issuable, author)
- if issuable.discussion_locked
- body = 'locked this issue'
- action = 'locked'
- else
- body = 'unlocked this issue'
- action = 'unlocked'
- end
+ action = issuable.discussion_locked? ? 'locked' : 'unlocked'
+ body = "#{action} this issue"
create_note(NoteSummary.new(issuable, issuable.project, author, body, action: action))
end