diff options
author | Robert Speicher <rspeicher@gmail.com> | 2019-04-17 15:26:19 +0200 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2019-04-29 13:49:11 -0500 |
commit | 888e57130896fd3dc59f5e60dcaa06cbc2d27c7b (patch) | |
tree | b8983f4e20c8098836a7e1943ed41586f8efde67 /lib/api | |
parent | 7ae2107d9ebca0adecc8a21cacd1bfb6e89ee3ab (diff) | |
download | gitlab-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')
-rw-r--r-- | lib/api/entities.rb | 4 |
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 |