Sha256: 3377e557926d1b00336b0306cb4ffd23633f2b8dee8e0bec6d1284f334e64c8a
Contents?: true
Size: 400 Bytes
Versions: 55
Compression:
Stored size: 400 Bytes
Contents
module Volt class PresenceValidator def self.validate(model, field_name, args) errors = {} value = model.get(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 errors end end end
Version data entries
55 entries across 55 versions & 1 rubygems