summaryrefslogtreecommitdiff
path: root/lib/api/entities.rb
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2019-04-17 15:26:19 +0200
committerRobert Speicher <rspeicher@gmail.com>2019-04-29 13:49:11 -0500
commit888e57130896fd3dc59f5e60dcaa06cbc2d27c7b (patch)
treeb8983f4e20c8098836a7e1943ed41586f8efde67 /lib/api/entities.rb
parent7ae2107d9ebca0adecc8a21cacd1bfb6e89ee3ab (diff)
downloadgitlab-ce-rs-commit-web_url.tar.gz
Expose web_url attribute in Commits APIrs-commit-web_url
This continues our emerging standard of including this attribute for resources that have web-accessible endpoints.
Diffstat (limited to 'lib/api/entities.rb')
-rw-r--r--lib/api/entities.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index ee8480122c4..8266b7d2392 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -393,6 +393,10 @@ module API
expose :safe_message, as: :message
expose :author_name, :author_email, :authored_date
expose :committer_name, :committer_email, :committed_date
+
+ expose :web_url do |commit|
+ Gitlab::Routing.url_helpers.project_commit_url(commit.project, commit)
+ end
end
class CommitStats < Grape::Entity