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

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

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

    belongs_to :candidate, class_name: 'Ml::Candidate'
  end
end