Class: Gitlab::Config::Entry::Validators::RegexpValidator

Inherits:
ActiveModel::EachValidator
  • Object
show all
Includes:
LegacyValidationHelpers
Defined in:
lib/gitlab/config/entry/validators.rb

Instance Method Summary collapse

Instance Method Details

#validate_each(record, attribute, value) ⇒ Object


164
165
166
167
168
# File 'lib/gitlab/config/entry/validators.rb', line 164

def validate_each(record, attribute, value)
  unless validate_regexp(value)
    record.errors.add(attribute, 'must be a regular expression')
  end
end