Welcome to mirror list, hosted at ThFree Co, Russian Federation.

model_metadata.rb « ml « models « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9c4273c629c4ea29f2904860e81be431e497fa90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
# frozen_string_literal: true

module Ml
  class ModelMetadata < ApplicationRecord
    validates :name,
      length: { maximum: 250 },
      presence: true,
      uniqueness: { scope: :model, message: ->(metadata, _) { "'#{metadata.name}' already taken" } }
    validates :value, length: { maximum: 5000 }, presence: true

    belongs_to :model, class_name: 'Ml::Model', optional: false
  end
end