Sha256: 445fd1f7d72e88231ecfeb52a71e8edada4ea97d779a7cf6f966421a740d41c3
Contents?: true
Size: 361 Bytes
Versions: 32
Compression:
Stored size: 361 Bytes
Contents
class PresenceValidator def self.validate(model, field_name, args) errors = {} value = model.send(field_name) if !value || value.blank? if args.is_a?(Hash) && args[:message] message = args[:message] else message = "must be specified" end errors[field_name] = [message] end return errors end end
Version data entries
32 entries across 32 versions & 1 rubygems