summaryrefslogtreecommitdiff
path: root/app/presenters/issue_presenter.rb
blob: 3d55b00ac3b99a81a6cdf0be14305502ff3070cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# frozen_string_literal: true

class IssuePresenter < Gitlab::View::Presenter::Delegated
  presents :issue

  def web_url
    url_builder.url
  end

  def issue_path
    url_builder.issue_path(issue)
  end

  def subscribed?
    issue.subscribed?(current_user, issue.project)
  end

  private

  def url_builder
    @url_builder ||= Gitlab::UrlBuilder.new(issue)
  end
end