Sha256: b41c87c2ef0d4ad0e096e48ea82c0c9aee0f96e30f17fbaee6c5ce1e506a6ddf
Contents?: true
Size: 369 Bytes
Versions: 16
Compression:
Stored size: 369 Bytes
Contents
# frozen_string_literal: true module Eac # 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
16 entries across 16 versions & 1 rubygems