summaryrefslogtreecommitdiff
path: root/lib/api/entities.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-14 21:06:30 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-14 21:06:30 +0000
commit565fa11a26c6824b1c6072d2dc5459979345ee57 (patch)
tree2668b631d925341e121c06b7b77cfe12954a015a /lib/api/entities.rb
parent8c30d396c5a789080345303330069981aa06e4af (diff)
downloadgitlab-ce-565fa11a26c6824b1c6072d2dc5459979345ee57.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/api/entities.rb')
-rw-r--r--lib/api/entities.rb24
1 files changed, 22 insertions, 2 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index 3f67aa2ad5a..522f3ed5565 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -1314,6 +1314,10 @@ module API
release.links.sorted
end
end
+ expose :_links do
+ expose :merge_requests_url
+ expose :issues_url
+ end
private
@@ -1324,11 +1328,27 @@ module API
def commit_path
return unless object.commit
- Gitlab::Routing.url_helpers.project_commit_path(object.project, object.commit.id)
+ Gitlab::Routing.url_helpers.project_commit_path(project, object.commit.id)
end
def tag_path
- Gitlab::Routing.url_helpers.project_tag_path(object.project, object.tag)
+ Gitlab::Routing.url_helpers.project_tag_path(project, object.tag)
+ end
+
+ def merge_requests_url
+ Gitlab::Routing.url_helpers.project_merge_requests_url(project, params_for_issues_and_mrs)
+ end
+
+ def issues_url
+ Gitlab::Routing.url_helpers.project_issues_url(project, params_for_issues_and_mrs)
+ end
+
+ def params_for_issues_and_mrs
+ { scope: 'all', state: 'opened', release_tag: object.tag }
+ end
+
+ def project
+ @project ||= object.project
end
end