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:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-10-17 22:48:46 +0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-10-19 19:58:27 +0300
commit8379fbcd47930320bf4dd6a3ac41c6efd427a91a (patch)
treec7f2f16f69032ae1584837c203d003c6b756ba25 /app/helpers
parentd3b76e832f0afc38e2d0ffdff540c708a74ac26c (diff)
Add subject to group and projects labels which return group/project
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/labels_helper.rb10
1 files changed, 2 insertions, 8 deletions
diff --git a/app/helpers/labels_helper.rb b/app/helpers/labels_helper.rb
index af8741f5e06..a1d7713b45f 100644
--- a/app/helpers/labels_helper.rb
+++ b/app/helpers/labels_helper.rb
@@ -14,7 +14,7 @@ module LabelsHelper
#
# Examples:
#
- # # Allow the generated link to use the label's own project
+ # # Allow the generated link to use the label's own subject
# link_to_label(label)
#
# # Force the generated link to use a provided group
@@ -31,13 +31,7 @@ module LabelsHelper
#
# Returns a String
def link_to_label(label, subject: nil, type: :issue, tooltip: true, css_class: nil, &block)
- subject ||=
- case label
- when GroupLabel then label.group
- when ProjectLabel then label.project
- end
-
- link = label_filter_path(subject, label, type: type)
+ link = label_filter_path(subject || label.subject, label, type: type)
if block_given?
link_to link, class: css_class, &block