diff options
author | Phil Hughes <me@iamphill.com> | 2019-06-04 16:38:18 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2019-06-05 10:46:32 +0300 |
commit | 4644a2daf5ec5e86e2b2989f04e99e4f081f6fef (patch) | |
tree | 40c9376ce43f2c2b9d964fb67b1c35cfb0077773 /app/presenters/tree_entry_presenter.rb | |
parent | df549eb28c83b27500619ccb14c201a4ff87daa3 (diff) |
Add web_url to tree entry in GraphQL API
Diffstat (limited to 'app/presenters/tree_entry_presenter.rb')
-rw-r--r-- | app/presenters/tree_entry_presenter.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/app/presenters/tree_entry_presenter.rb b/app/presenters/tree_entry_presenter.rb new file mode 100644 index 00000000000..7bb10cd1455 --- /dev/null +++ b/app/presenters/tree_entry_presenter.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class TreeEntryPresenter < Gitlab::View::Presenter::Delegated + presents :tree + + def web_url + Gitlab::Routing.url_helpers.project_tree_url(tree.repository.project, File.join(tree.commit_id, tree.path)) + end +end |