debian-mirror-gitlab/lib/gitlab/database/async_constraints/validators.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
418 B
Ruby
Raw Normal View History

2023-05-27 22:25:52 +05:30
# 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