Sha256: 49d95936b47edc78770c47e72fff31a3a9ef8c5bf3fee0626f998d4f49d04ef1
Contents?: true
Size: 388 Bytes
Versions: 29
Compression:
Stored size: 388 Bytes
Contents
module Validatable class ValidatesFormatOf < ValidationBase #:nodoc: required_option :with def valid?(instance) value = instance.send(self.attribute) return true if allow_nil && value.nil? return true if allow_blank && value.blank? not (value.to_s =~ self.with).nil? end def message(instance) super || "is invalid" end end end
Version data entries
29 entries across 29 versions & 8 rubygems