blob: 1191051b1a3df29fa7aa28dc728668571bdb51e1 (
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
|