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:
authorPhil Hughes <me@iamphill.com>2019-06-04 16:38:18 +0300
committerPhil Hughes <me@iamphill.com>2019-06-05 10:46:32 +0300
commit4644a2daf5ec5e86e2b2989f04e99e4f081f6fef (patch)
tree40c9376ce43f2c2b9d964fb67b1c35cfb0077773 /app/presenters/blob_presenter.rb
parentdf549eb28c83b27500619ccb14c201a4ff87daa3 (diff)
Add web_url to tree entry in GraphQL API
Diffstat (limited to 'app/presenters/blob_presenter.rb')
-rw-r--r--app/presenters/blob_presenter.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/presenters/blob_presenter.rb b/app/presenters/blob_presenter.rb
index 6323c1b3389..c5675ef3ea3 100644
--- a/app/presenters/blob_presenter.rb
+++ b/app/presenters/blob_presenter.rb
@@ -13,4 +13,8 @@ class BlobPresenter < Gitlab::View::Presenter::Simple
plain: plain
)
end
+
+ def web_url
+ Gitlab::Routing.url_helpers.project_blob_url(blob.repository.project, File.join(blob.commit_id, blob.path))
+ end
end