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

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

module WorkItems
  class HierarchyRestriction < ApplicationRecord
    self.table_name = 'work_item_hierarchy_restrictions'

    belongs_to :parent_type, class_name: 'WorkItems::Type'
    belongs_to :child_type, class_name: 'WorkItems::Type'

    validates :parent_type, presence: true
    validates :child_type, presence: true
    validates :child_type, uniqueness: { scope: :parent_type_id }
  end
end