Sha256: 04c415e57a2a802c49dee6c2632b68937ef6ce5f65f4a133c84ff584ae2d99c2
Contents?: true
Size: 349 Bytes
Versions: 5
Compression:
Stored size: 349 Bytes
Contents
module Validatable class ValidatesPresenceOf < ValidationBase #:nodoc: def valid?(instance) return false if instance.send(self.attribute).nil? instance.send(self.attribute).respond_to?(:strip) ? instance.send(self.attribute).strip.length != 0 : true end def message super || "can't be empty" end end end
Version data entries
5 entries across 5 versions & 1 rubygems