class Dbee::Model::Constraints::Reference

A Reference constraint is a constraint between two data models. In DB terms: the name represents the column name on the child and the parent represents the column name on the parent table.

Attributes

parent[R]

Public Class Methods

new(name:, parent:) click to toggle source
Calls superclass method Dbee::Model::Constraints::Base::new
# File lib/dbee/model/constraints/reference.rb, line 21
def initialize(name:, parent:)
  raise ArgumentError, 'name is required' if name.to_s.empty?
  raise ArgumentError, 'parent is required' if parent.to_s.empty?

  super(name: name, parent: parent)

  freeze
end