diff options
Diffstat (limited to 'app/presenters/ml/candidate_presenter.rb')
-rw-r--r-- | app/presenters/ml/candidate_presenter.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/app/presenters/ml/candidate_presenter.rb b/app/presenters/ml/candidate_presenter.rb new file mode 100644 index 00000000000..2465238d81e --- /dev/null +++ b/app/presenters/ml/candidate_presenter.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Ml + class CandidatePresenter < Gitlab::View::Presenter::Delegated + presents ::Ml::Candidate, as: :candidate + + def path + project_ml_candidate_path( + candidate.project, + candidate.iid + ) + end + + def artifact_path + return unless candidate.package_id.present? + + project_package_path(candidate.project, candidate.package_id) + end + end +end |