Class: IssuePresenter

Inherits:
Gitlab::View::Presenter::Delegated show all
Defined in:
app/presenters/issue_presenter.rb

Instance Method Summary collapse

Methods inherited from Gitlab::View::Presenter::Delegated

#initialize

Methods included from Gitlab::Utils::DelegatorOverride

#delegator_override, #delegator_override_with, #delegator_target, validator, validators, verify!

Methods included from Gitlab::View::Presenter::Base

#__subject__, #can?, #declarative_policy_delegate, #is_a?, #present, #url_builder, #web_path

Methods included from Gitlab::Allowable

#can?

Methods included from Gitlab::Routing

add_helpers, includes_helpers, redirect_legacy_paths, url_helpers

Constructor Details

This class inherits a constructor from Gitlab::View::Presenter::Delegated

Instance Method Details

#issue_pathObject


6
7
8
9
10
# File 'app/presenters/issue_presenter.rb', line 6

def issue_path
  return url_builder.build(issue, only_path: true) unless use_work_items_path?

  project_work_items_path(issue.project, work_items_path: issue.id)
end

#project_emails_disabled?Boolean

Returns:

  • (Boolean)

17
18
19
# File 'app/presenters/issue_presenter.rb', line 17

def project_emails_disabled?
  issue.project.emails_disabled?
end

#subscribed?Boolean

Returns:

  • (Boolean)

13
14
15
# File 'app/presenters/issue_presenter.rb', line 13

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

#web_urlObject


21
22
23
24
25
# File 'app/presenters/issue_presenter.rb', line 21

def web_url
  return super unless use_work_items_path?

  project_work_items_url(issue.project, work_items_path: issue.id)
end