diff options
author | George Tsiolis <tsiolis.g@gmail.com> | 2018-11-06 14:44:47 +0200 |
---|---|---|
committer | George Tsiolis <tsiolis.g@gmail.com> | 2018-11-06 15:05:20 +0200 |
commit | fc668d6917f6ef447c5e30d279db3621fa15498f (patch) | |
tree | 1827c9cef99d80153463637d881fe6ce063c2637 /app/helpers/events_helper.rb | |
parent | 780f51eaf86a613402902668ac40c36fe762d510 (diff) | |
download | gitlab-ce-fc668d6917f6ef447c5e30d279db3621fa15498f.tar.gz |
Add issue or merge request reference prefix in the event feed title
Diffstat (limited to 'app/helpers/events_helper.rb')
-rw-r--r-- | app/helpers/events_helper.rb | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/app/helpers/events_helper.rb b/app/helpers/events_helper.rb index 373027c66ec..06e23a03298 100644 --- a/app/helpers/events_helper.rb +++ b/app/helpers/events_helper.rb @@ -90,12 +90,15 @@ module EventsHelper elsif event.milestone? words << "##{event.target_iid}" if event.target_iid words << "in" - elsif event.merge_request? - words << "#{Issue.reference_prefix}#{event.target_iid}:" if event.target_iid - words << event.target.title if event.target.respond_to?(:title) - words << "at" elsif event.target - words << "#{MergeRequest.reference_prefix}#{event.target_iid}:" + prefix = + if event.merge_request? + MergeRequest.reference_prefix + else + Issue.reference_prefix + end + + words << "#{prefix}#{event.target_iid}:" if event.target_iid words << event.target.title if event.target.respond_to?(:title) words << "at" end |