summaryrefslogtreecommitdiff
path: root/app/services/system_note_service.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/system_note_service.rb')
-rw-r--r--app/services/system_note_service.rb19
1 files changed, 7 insertions, 12 deletions
diff --git a/app/services/system_note_service.rb b/app/services/system_note_service.rb
index e9e3c472e6d..972f8b2012d 100644
--- a/app/services/system_note_service.rb
+++ b/app/services/system_note_service.rb
@@ -169,29 +169,24 @@ class SystemNoteService
#
# Returns the created Note object
def self.change_title(noteable, project, author, old_title)
- return unless noteable.respond_to?(:title)
-
body = "Title changed from **#{old_title}** to **#{noteable.title}**"
create_note(noteable: noteable, project: project, author: author, note: body)
end
# Called when the confidentiality changes
#
- # noteable - Noteable object that responds to 'confidential'
- # project - Project owning noteable
- # author - User performing the change
+ # issue - Issue object
+ # project - Project owning the issue
+ # author - User performing the change
#
# Example Note text:
#
- # "Marked as confidential"
+ # "Made the issue confidential"
#
# Returns the created Note object
- def self.change_confidentiality(noteable, project, author)
- return unless noteable.respond_to?(:confidential)
-
- confidentiality_status = noteable.confidential ? "confidential" : "not confidential"
- body = "Marked as #{confidentiality_status}"
- create_note(noteable: noteable, project: project, author: author, note: body)
+ def self.change_issue_confidentiality(issue, project, author)
+ body = issue.confidential ? 'Made the issue confidential' : 'Made the issue visible'
+ create_note(noteable: issue, project: project, author: author, note: body)
end
# Called when a branch in Noteable is changed