Sha256: c1b7cd00ee277c5f92f0a53dcb541c0a9ad300c22c03bd7568594ea2bbe58c98
Contents?: true
Size: 287 Bytes
Versions: 72
Compression:
Stored size: 287 Bytes
Contents
class UrlValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) valid = begin URI.parse(value).kind_of?(URI::HTTP) rescue URI::InvalidURIError false end unless valid record.errors.add attribute, :invalid end end end
Version data entries
72 entries across 72 versions & 1 rubygems