Method: UrlValidator#validate_each

Defined in:
lib/validators/url_validator.rb

#validate_each(record, attribute, value) ⇒ Object



8
9
10
11
12
# File 'lib/validators/url_validator.rb', line 8

def validate_each(record, attribute, value)
  if value.present?
    record.errors.add(attribute, 'is invalid') unless PATTERN =~ value
  end
end