2023-03-04 22:38:38 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Ml
|
|
|
|
class ExperimentMetadata < ApplicationRecord
|
|
|
|
validates :experiment, presence: true
|
|
|
|
validates :name,
|
2023-07-09 08:55:56 +05:30
|
|
|
length: { maximum: 250 },
|
|
|
|
presence: true,
|
|
|
|
uniqueness: { scope: :experiment, message: ->(exp, _) { "'#{exp.name}' already taken" } }
|
2023-03-04 22:38:38 +05:30
|
|
|
validates :value, length: { maximum: 5000 }, presence: true
|
|
|
|
|
|
|
|
belongs_to :experiment, class_name: 'Ml::Experiment'
|
|
|
|
end
|
|
|
|
end
|