Class: Ml::CandidatePresenter
- Inherits:
-
Gitlab::View::Presenter::Delegated
- Object
- SimpleDelegator
- Gitlab::View::Presenter::Delegated
- Ml::CandidatePresenter
- Defined in:
- app/presenters/ml/candidate_presenter.rb
Instance Method Summary collapse
Methods inherited from Gitlab::View::Presenter::Delegated
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?, #path_with_line_numbers, #present, #url_builder, #web_path, #web_url
Methods included from Gitlab::Allowable
Methods included from Gitlab::Routing
includes_helpers, redirect_legacy_paths, url_helpers
Constructor Details
This class inherits a constructor from Gitlab::View::Presenter::Delegated
Instance Method Details
#artifact_show_path ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/presenters/ml/candidate_presenter.rb', line 14 def artifact_show_path package_id = if candidate.model_version candidate.model_version.package_id else candidate.package_id end return unless package_id.present? project_package_path(candidate.project, package_id) end |
#ci_build ⇒ Object
27 28 29 30 31 |
# File 'app/presenters/ml/candidate_presenter.rb', line 27 def ci_build return unless candidate.from_ci? && Ability.allowed?(current_user, :read_build, candidate.ci_build) candidate.ci_build end |
#path ⇒ Object
7 8 9 10 11 12 |
# File 'app/presenters/ml/candidate_presenter.rb', line 7 def path project_ml_candidate_path( candidate.project, candidate.iid ) end |