Sha256: aabad6300e5398fb3d68cccb061396c6cfe9cf19f7655c8a17b0d536a0f8b601
Contents?: true
Size: 379 Bytes
Versions: 7
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.add(attribute, options[:message] || 'must be blank') end end end
Version data entries
7 entries across 7 versions & 1 rubygems