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

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

module Ml
  class CandidateMetric < ApplicationRecord
    validates :candidate, presence: true
    validates :name, length: { maximum: 250 }, presence: true

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

    scope :latest, -> { select('DISTINCT ON (candidate_id, name) *').order('candidate_id, name, id DESC') }
  end
end