diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-04 21:07:04 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-04 21:07:04 +0300 |
commit | f2f95cc1bac06c8b4e506f02c1b90754adda67ec (patch) | |
tree | de147240f9a142dac58c1eb9d81106ade924163a /app/presenters/ml | |
parent | f7bd454bd5bfd5494e8a89fe1594f0612024bd6a (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/presenters/ml')
-rw-r--r-- | app/presenters/ml/models_index_presenter.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/app/presenters/ml/models_index_presenter.rb b/app/presenters/ml/models_index_presenter.rb new file mode 100644 index 00000000000..e2cb8e2d6c1 --- /dev/null +++ b/app/presenters/ml/models_index_presenter.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Ml + class ModelsIndexPresenter + def initialize(models) + @models = models + end + + def present + data = @models.map do |m| + { + name: m.name, + version: m.version, + path: Gitlab::Routing.url_helpers.project_package_path(m.project, m) + } + end + + Gitlab::Json.generate({ models: data }) + end + end +end |