Sha256: ccc6b6b89c8703620b8af2120aa6c10d766458e0b24b8edc91fdc59955805e41
Contents?: true
Size: 422 Bytes
Versions: 10
Compression:
Stored size: 422 Bytes
Contents
module Volt class PresenceValidator def self.validate(model, old_model, field_name, args) errors = {} value = model.read_attribute(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
10 entries across 10 versions & 1 rubygems