Sha256: 17e68a4a6ecd017dfef98fa438017fabb3df394f5a9c4ffb9fbca8586b30e10c
Contents?: true
Size: 379 Bytes
Versions: 33
Compression:
Stored size: 379 Bytes
Contents
# frozen_string_literal: true module EacRailsUtils # https://stackoverflow.com/questions/10070786/rails-3-validation-presence-false class NoPresenceValidator < ActiveModel::EachValidator def validate_each(record, attribute, _value) return if record.send(attribute).blank? record.errors[attribute] << (options[:message] || 'must be blank') end end end
Version data entries
33 entries across 33 versions & 1 rubygems