diff options
Diffstat (limited to 'app/services/system_notes/issuables_service.rb')
-rw-r--r-- | app/services/system_notes/issuables_service.rb | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/app/services/system_notes/issuables_service.rb b/app/services/system_notes/issuables_service.rb index 61a4316e8ae..04ae734a8fe 100644 --- a/app/services/system_notes/issuables_service.rb +++ b/app/services/system_notes/issuables_service.rb @@ -32,8 +32,7 @@ module SystemNotes # # Returns the created Note object def relate_issuable(noteable_ref) - issuable_type = noteable.to_ability_name.humanize(capitalize: false) - body = "marked this #{issuable_type} as related to #{noteable_ref.to_reference(noteable.resource_parent)}" + body = "marked this #{noteable_name} as related to #{noteable_ref.to_reference(noteable.resource_parent)}" track_issue_event(:track_issue_related_action) @@ -351,12 +350,12 @@ module SystemNotes # Returns the created Note object def change_issue_confidentiality if noteable.confidential - body = 'made the issue confidential' + body = "made the #{noteable_name} confidential" action = 'confidential' track_issue_event(:track_issue_made_confidential_action) else - body = 'made the issue visible to everyone' + body = "made the #{noteable_name} visible to everyone" action = 'visible' track_issue_event(:track_issue_made_visible_action) @@ -534,6 +533,12 @@ module SystemNotes issue_activity_counter.public_send(event_name, author: author, project: project || noteable.project) # rubocop: disable GitlabSecurity/PublicSend end + + def noteable_name + name = noteable.try(:issue_type) || noteable.to_ability_name + + name.humanize(capitalize: false) + end end end |