debian-mirror-gitlab/app/controllers/projects/ml/candidates_controller.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

35 lines
810 B
Ruby
Raw Normal View History

2023-03-04 22:38:38 +05:30
# frozen_string_literal: true
module Projects
module Ml
class CandidatesController < ApplicationController
2023-06-20 00:43:36 +05:30
before_action :check_feature_flag, :set_candidate
2023-03-04 22:38:38 +05:30
feature_category :mlops
2023-06-20 00:43:36 +05:30
def show; end
2023-03-04 22:38:38 +05:30
2023-06-20 00:43:36 +05:30
def destroy
@experiment = @candidate.experiment
@candidate.destroy!
redirect_to project_ml_experiment_path(@project, @experiment.iid),
status: :found,
notice: s_("MlExperimentTracking|Candidate removed")
2023-03-04 22:38:38 +05:30
end
private
2023-06-20 00:43:36 +05:30
def set_candidate
@candidate = ::Ml::Candidate.with_project_id_and_iid(@project.id, params['iid'])
render_404 unless @candidate.present?
end
2023-03-04 22:38:38 +05:30
def check_feature_flag
render_404 unless Feature.enabled?(:ml_experiment_tracking, @project)
end
end
end
end