debian-mirror-gitlab/lib/gitlab/database/async_constraints/validators.rb
2023-05-27 22:25:52 +05:30

20 lines
418 B
Ruby

# frozen_string_literal: true
module Gitlab
module Database
module AsyncConstraints
module Validators
MAPPING = {
foreign_key: Validators::ForeignKey,
check_constraint: Validators::CheckConstraint
}.freeze
def self.for(record)
MAPPING
.fetch(record.constraint_type.to_sym)
.new(record)
end
end
end
end
end