Sha256: 7136274f425c42a86d3aca1f3cf972b7b903099bd21bd2451cb18c8fb44ada3e
Contents?: true
Size: 295 Bytes
Versions: 31
Compression:
Stored size: 295 Bytes
Contents
module Validators # Checks that an attribute is absent. # The opposite of PresenceValidator class AbsenceValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) record.errors.add(attribute, :invalid, options) unless value.blank? end end end
Version data entries
31 entries across 31 versions & 1 rubygems